Skip to content
Snippets Groups Projects
Commit eadb8977 authored by Amaury Johnen's avatar Amaury Johnen
Browse files

fix bug sampleIGEMeasure

parent a3814bd8
No related branches found
No related tags found
No related merge requests found
...@@ -48,29 +48,27 @@ static inline void computeCoeffLengthVectors_(const fullMatrix<double> &mat, ...@@ -48,29 +48,27 @@ static inline void computeCoeffLengthVectors_(const fullMatrix<double> &mat,
pow_int(mat(i, 4), 2) + pow_int(mat(i, 4), 2) +
pow_int(mat(i, 5), 2) ); pow_int(mat(i, 5), 2) );
} }
if (mat.size2() > 6) { // if 3D if (type == TYPE_TRI) {
for (int i = 0; i < sz1; i++) {
coeff(i, 2) = std::sqrt(pow_int(mat(i, 3) - mat(i, 0), 2) +
pow_int(mat(i, 4) - mat(i, 1), 2) +
pow_int(mat(i, 5) - mat(i, 2), 2) );
}
}
else if (type != TYPE_QUA) { // if 3D
for (int i = 0; i < sz1; i++) { for (int i = 0; i < sz1; i++) {
coeff(i, 2) = std::sqrt(pow_int(mat(i, 6), 2) + coeff(i, 2) = std::sqrt(pow_int(mat(i, 6), 2) +
pow_int(mat(i, 7), 2) + pow_int(mat(i, 7), 2) +
pow_int(mat(i, 8), 2) ); pow_int(mat(i, 8), 2) );
} }
} }
else if (type == TYPE_TRI) { if (type == TYPE_TET || type == TYPE_PRI) {
for (int i = 0; i < sz1; i++) { for (int i = 0; i < sz1; i++) {
coeff(i, 2) = std::sqrt(pow_int(mat(i, 3) - mat(i, 0), 2) + coeff(i, 3) = std::sqrt(pow_int(mat(i, 3) - mat(i, 0), 2) +
pow_int(mat(i, 4) - mat(i, 1), 2) + pow_int(mat(i, 4) - mat(i, 1), 2) +
pow_int(mat(i, 5) - mat(i, 2), 2) ); pow_int(mat(i, 5) - mat(i, 2), 2) );
} }
} }
switch (type) {
case TYPE_TET:
case TYPE_PRI:
for (int i = 0; i < sz1; i++) {
coeff(i, 3) = std::sqrt(pow_int(mat(i, 3) - mat(i, 0), 2) +
pow_int(mat(i, 4) - mat(i, 1), 2) +
pow_int(mat(i, 5) - mat(i, 2), 2) );
}
}
if (type == TYPE_TET) { if (type == TYPE_TET) {
for (int i = 0; i < sz1; i++) { for (int i = 0; i < sz1; i++) {
coeff(i, 4) = std::sqrt(pow_int(mat(i, 6) - mat(i, 0), 2) + coeff(i, 4) = std::sqrt(pow_int(mat(i, 6) - mat(i, 0), 2) +
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment