Fixing dashboard warnings

This commit is contained in:
Abhishek Yenpure 2022-02-02 17:12:30 +05:30
parent 8ddcad824c
commit 4db0cecc1f
10 changed files with 70 additions and 61 deletions

@ -274,9 +274,10 @@ VTKM_EXEC OutType CellDimensionMetric(const vtkm::IdComponent& numPts,
gradop[7][2] = (x7 * (y3 - y6 - y54) + x6 * y75 + x5 * (y6 - y1 - y47) + x4 * (y1 - y3 - y75) +
x3 * y47 + x1 * y54) /
(OutType)12.0;
OutType volume = pts[0][0] * gradop[0][0] + pts[1][0] * gradop[1][0] + pts[2][0] * gradop[2][0] +
pts[3][0] * gradop[3][0] + pts[4][0] * gradop[4][0] + pts[5][0] * gradop[5][0] +
pts[6][0] * gradop[6][0] + pts[7][0] * gradop[7][0];
OutType volume = OutType(pts[0][0]) * gradop[0][0] + OutType(pts[1][0]) * gradop[1][0] +
OutType(pts[2][0]) * gradop[2][0] + OutType(pts[3][0]) * gradop[3][0] +
OutType(pts[4][0]) * gradop[4][0] + OutType(pts[5][0]) * gradop[5][0] +
OutType(pts[6][0]) * gradop[6][0] + OutType(pts[7][0]) * gradop[7][0];
OutType two = (OutType)2.;
OutType aspect = (OutType).5 * vtkm::Pow(volume, two) /
(vtkm::Pow(gradop[0][0], two) + vtkm::Pow(gradop[1][0], two) + vtkm::Pow(gradop[2][0], two) +

@ -176,7 +176,7 @@ VTKM_EXEC OutType CellJacobianMetric(const vtkm::IdComponent& numPts,
const Vector L2 = GetTetraL2<Scalar, Vector, CollectionOfPoints>(pts);
const Vector L3 = GetTetraL3<Scalar, Vector, CollectionOfPoints>(pts);
const Scalar q = vtkm::Dot(vtkm::Cross(L2, L0), L3);
const Scalar q = static_cast<Scalar>((vtkm::Dot(vtkm::Cross(L2, L0), L3)));
return q;
}

@ -164,16 +164,20 @@ VTKM_EXEC OutType CellMaxAngleMetric(const vtkm::IdComponent& numPts,
const Scalar oneEightyOverPi = (Scalar)57.2957795131; // ~ 180/pi
const Scalar threeSixty(360.0);
const Scalar q0 =
(vtkm::Pow(neg1, s0) * vtkm::ACos(neg1 * ((vtkm::Dot(L0, L1)) / (l0 * l1))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s0) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L0, L1)) / (l0 * l1))) *
oneEightyOverPi) +
(threeSixty * s0);
const Scalar q1 =
(vtkm::Pow(neg1, s1) * vtkm::ACos(neg1 * ((vtkm::Dot(L1, L2)) / (l1 * l2))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s1) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L1, L2)) / (l1 * l2))) *
oneEightyOverPi) +
(threeSixty * s1);
const Scalar q2 =
(vtkm::Pow(neg1, s2) * vtkm::ACos(neg1 * ((vtkm::Dot(L2, L3)) / (l2 * l3))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s2) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L2, L3)) / (l2 * l3))) *
oneEightyOverPi) +
(threeSixty * s2);
const Scalar q3 =
(vtkm::Pow(neg1, s3) * vtkm::ACos(neg1 * ((vtkm::Dot(L3, L0)) / (l3 * l0))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s3) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L3, L0)) / (l3 * l0))) *
oneEightyOverPi) +
(threeSixty * s3);
const Scalar q = vtkm::Max(q0, vtkm::Max(q1, vtkm::Max(q2, q3)));

@ -82,28 +82,28 @@ VTKM_EXEC OutType CellMaxDiagonalMetric(const vtkm::IdComponent& numPts,
//lengths^2 f diag nals
for (i = 0; i < 3; i++)
{
temp[i] = pts[6][i] - pts[0][i];
temp[i] = static_cast<Scalar>(pts[6][i] - pts[0][i]);
temp[i] = temp[i] * temp[i];
}
diag[0] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);
for (i = 0; i < 3; i++)
{
temp[i] = pts[4][i] - pts[2][i];
temp[i] = static_cast<Scalar>(pts[4][i] - pts[2][i]);
temp[i] = temp[i] * temp[i];
}
diag[1] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);
for (i = 0; i < 3; i++)
{
temp[i] = pts[7][i] - pts[1][i];
temp[i] = static_cast<Scalar>(pts[7][i] - pts[1][i]);
temp[i] = temp[i] * temp[i];
}
diag[2] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);
for (i = 0; i < 3; i++)
{
temp[i] = pts[5][i] - pts[3][i];
temp[i] = static_cast<Scalar>(pts[5][i] - pts[3][i]);
temp[i] = temp[i] * temp[i];
}
diag[3] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);

@ -161,16 +161,20 @@ VTKM_EXEC OutType CellMinAngleMetric(const vtkm::IdComponent& numPts,
const Scalar oneEightyOverPi = (Scalar)57.2957795131; // ~ 180/pi
const Scalar threeSixty(360.0);
const Scalar q0 =
(vtkm::Pow(neg1, s0) * vtkm::ACos(neg1 * ((vtkm::Dot(L0, L1)) / (l0 * l1))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s0) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L0, L1)) / (l0 * l1))) *
oneEightyOverPi) +
(threeSixty * s0);
const Scalar q1 =
(vtkm::Pow(neg1, s1) * vtkm::ACos(neg1 * ((vtkm::Dot(L1, L2)) / (l1 * l2))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s1) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L1, L2)) / (l1 * l2))) *
oneEightyOverPi) +
(threeSixty * s1);
const Scalar q2 =
(vtkm::Pow(neg1, s2) * vtkm::ACos(neg1 * ((vtkm::Dot(L2, L3)) / (l2 * l3))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s2) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L2, L3)) / (l2 * l3))) *
oneEightyOverPi) +
(threeSixty * s2);
const Scalar q3 =
(vtkm::Pow(neg1, s3) * vtkm::ACos(neg1 * ((vtkm::Dot(L3, L0)) / (l3 * l0))) * oneEightyOverPi) +
(vtkm::Pow(neg1, s3) * vtkm::ACos(neg1 * (static_cast<Scalar>(vtkm::Dot(L3, L0)) / (l3 * l0))) *
oneEightyOverPi) +
(threeSixty * s3);
const Scalar q = vtkm::Min(q0, vtkm::Min(q1, vtkm::Min(q2, q3)));

@ -82,28 +82,28 @@ VTKM_EXEC OutType CellMinDiagonalMetric(const vtkm::IdComponent& numPts,
//lengths^2 f diag nals
for (i = 0; i < 3; i++)
{
temp[i] = pts[6][i] - pts[0][i];
temp[i] = static_cast<Scalar>(pts[6][i] - pts[0][i]);
temp[i] = temp[i] * temp[i];
}
diag[0] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);
for (i = 0; i < 3; i++)
{
temp[i] = pts[4][i] - pts[2][i];
temp[i] = static_cast<Scalar>(pts[4][i] - pts[2][i]);
temp[i] = temp[i] * temp[i];
}
diag[1] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);
for (i = 0; i < 3; i++)
{
temp[i] = pts[7][i] - pts[1][i];
temp[i] = static_cast<Scalar>(pts[7][i] - pts[1][i]);
temp[i] = temp[i] * temp[i];
}
diag[2] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);
for (i = 0; i < 3; i++)
{
temp[i] = pts[5][i] - pts[3][i];
temp[i] = static_cast<Scalar>(pts[5][i] - pts[3][i]);
temp[i] = temp[i] * temp[i];
}
diag[3] = vtkm::Sqrt(temp[0] + temp[1] + temp[2]);

@ -190,21 +190,21 @@ VTKM_EXEC OutType CellOddyMetric(const vtkm::IdComponent& numPts,
// Note that the values 1_2 = 2_1, 1_3 = 3_1, and 2_3 = 3_2.
// This fact is used to optimize the computation
*/
tempMatrix1_1 =
vtkm::Dot(hexJacobianMatrices[matrixNumber][0], hexJacobianMatrices[matrixNumber][0]);
tempMatrix1_2 =
vtkm::Dot(hexJacobianMatrices[matrixNumber][0], hexJacobianMatrices[matrixNumber][1]);
tempMatrix1_3 =
vtkm::Dot(hexJacobianMatrices[matrixNumber][0], hexJacobianMatrices[matrixNumber][2]);
tempMatrix2_2 =
vtkm::Dot(hexJacobianMatrices[matrixNumber][1], hexJacobianMatrices[matrixNumber][1]);
tempMatrix2_3 =
vtkm::Dot(hexJacobianMatrices[matrixNumber][1], hexJacobianMatrices[matrixNumber][2]);
tempMatrix3_3 =
vtkm::Dot(hexJacobianMatrices[matrixNumber][2], hexJacobianMatrices[matrixNumber][2]);
determinant = vtkm::Dot(
tempMatrix1_1 = static_cast<OutType>(
vtkm::Dot(hexJacobianMatrices[matrixNumber][0], hexJacobianMatrices[matrixNumber][0]));
tempMatrix1_2 = static_cast<OutType>(
vtkm::Dot(hexJacobianMatrices[matrixNumber][0], hexJacobianMatrices[matrixNumber][1]));
tempMatrix1_3 = static_cast<OutType>(
vtkm::Dot(hexJacobianMatrices[matrixNumber][0], hexJacobianMatrices[matrixNumber][2]));
tempMatrix2_2 = static_cast<OutType>(
vtkm::Dot(hexJacobianMatrices[matrixNumber][1], hexJacobianMatrices[matrixNumber][1]));
tempMatrix2_3 = static_cast<OutType>(
vtkm::Dot(hexJacobianMatrices[matrixNumber][1], hexJacobianMatrices[matrixNumber][2]));
tempMatrix3_3 = static_cast<OutType>(
vtkm::Dot(hexJacobianMatrices[matrixNumber][2], hexJacobianMatrices[matrixNumber][2]));
determinant = static_cast<OutType>(vtkm::Dot(
hexJacobianMatrices[matrixNumber][0],
vtkm::Cross(hexJacobianMatrices[matrixNumber][1], hexJacobianMatrices[matrixNumber][2]));
vtkm::Cross(hexJacobianMatrices[matrixNumber][1], hexJacobianMatrices[matrixNumber][2])));
if (determinant <= OutType(0.0))
{
return vtkm::Infinity<OutType>();

@ -151,26 +151,26 @@ VTKM_EXEC OutType CellRelativeSizeSquaredMetric(const vtkm::IdComponent& numPts,
ec = vtkm::ErrorCode::InvalidNumberOfPoints;
return OutType(-1.);
}
OutType X1x = (pts[1][0] - pts[0][0]) + (pts[2][0] - pts[3][0]) + (pts[5][0] - pts[4][0]) +
(pts[6][0] - pts[7][0]);
OutType X1y = (pts[1][1] - pts[0][1]) + (pts[2][1] - pts[3][1]) + (pts[5][1] - pts[4][1]) +
(pts[6][1] - pts[7][1]);
OutType X1z = (pts[1][2] - pts[0][2]) + (pts[2][2] - pts[3][2]) + (pts[5][2] - pts[4][2]) +
(pts[6][2] - pts[7][2]);
OutType X1x = static_cast<OutType>((pts[1][0] - pts[0][0]) + (pts[2][0] - pts[3][0]) +
(pts[5][0] - pts[4][0]) + (pts[6][0] - pts[7][0]));
OutType X1y = static_cast<OutType>((pts[1][1] - pts[0][1]) + (pts[2][1] - pts[3][1]) +
(pts[5][1] - pts[4][1]) + (pts[6][1] - pts[7][1]));
OutType X1z = static_cast<OutType>((pts[1][2] - pts[0][2]) + (pts[2][2] - pts[3][2]) +
(pts[5][2] - pts[4][2]) + (pts[6][2] - pts[7][2]));
OutType X2x = (pts[2][0] - pts[0][0]) + (pts[2][0] - pts[1][0]) + (pts[7][0] - pts[4][0]) +
(pts[6][0] - pts[5][0]);
OutType X2y = (pts[2][1] - pts[0][1]) + (pts[2][1] - pts[1][1]) + (pts[7][1] - pts[4][1]) +
(pts[6][1] - pts[5][1]);
OutType X2z = (pts[2][2] - pts[0][2]) + (pts[2][2] - pts[1][2]) + (pts[7][2] - pts[4][2]) +
(pts[6][2] - pts[5][2]);
OutType X2x = static_cast<OutType>((pts[2][0] - pts[0][0]) + (pts[2][0] - pts[1][0]) +
(pts[7][0] - pts[4][0]) + (pts[6][0] - pts[5][0]));
OutType X2y = static_cast<OutType>((pts[2][1] - pts[0][1]) + (pts[2][1] - pts[1][1]) +
(pts[7][1] - pts[4][1]) + (pts[6][1] - pts[5][1]));
OutType X2z = static_cast<OutType>((pts[2][2] - pts[0][2]) + (pts[2][2] - pts[1][2]) +
(pts[7][2] - pts[4][2]) + (pts[6][2] - pts[5][2]));
OutType X3x = (pts[4][0] - pts[0][0]) + (pts[5][0] - pts[1][0]) + (pts[6][0] - pts[2][0]) +
(pts[7][0] - pts[3][0]);
OutType X3y = (pts[4][1] - pts[0][1]) + (pts[5][1] - pts[1][1]) + (pts[6][1] - pts[2][1]) +
(pts[7][1] - pts[3][1]);
OutType X3z = (pts[4][2] - pts[0][2]) + (pts[5][2] - pts[1][2]) + (pts[6][2] - pts[2][2]) +
(pts[7][2] - pts[3][2]);
OutType X3x = static_cast<OutType>((pts[4][0] - pts[0][0]) + (pts[5][0] - pts[1][0]) +
(pts[6][0] - pts[2][0]) + (pts[7][0] - pts[3][0]));
OutType X3y = static_cast<OutType>((pts[4][1] - pts[0][1]) + (pts[5][1] - pts[1][1]) +
(pts[6][1] - pts[2][1]) + (pts[7][1] - pts[3][1]));
OutType X3z = static_cast<OutType>((pts[4][2] - pts[0][2]) + (pts[5][2] - pts[1][2]) +
(pts[6][2] - pts[2][2]) + (pts[7][2] - pts[3][2]));
vtkm::Matrix<OutType, 3, 3> A8;
vtkm::MatrixSetRow(A8, 0, vtkm::Vec<OutType, 3>(X1x, X1y, X1z));
vtkm::MatrixSetRow(A8, 1, vtkm::Vec<OutType, 3>(X2x, X2y, X2z));

@ -107,7 +107,7 @@ VTKM_EXEC OutType CellScaledJacobianMetric(const vtkm::IdComponent& numPts,
}
// compute jacobian of triangle
Vector TriCross = vtkm::Cross(l2, l1);
Scalar scaledJacobian = vtkm::Magnitude(TriCross);
Scalar scaledJacobian = static_cast<OutType>(vtkm::Magnitude(TriCross));
//add all pieces together
//TODO change
@ -279,13 +279,13 @@ VTKM_EXEC OutType CellScaledJacobianMetric(const vtkm::IdComponent& numPts,
Edge Edges[6] = { pts[1] - pts[0], pts[2] - pts[1], pts[0] - pts[2],
pts[3] - pts[0], pts[3] - pts[1], pts[3] - pts[2] };
OutType EdgesSquared[6];
OutType jacobian = vtkm::Dot(vtkm::Cross(Edges[2], Edges[0]), Edges[3]);
OutType jacobian = static_cast<OutType>(vtkm::Dot(vtkm::Cross(Edges[2], Edges[0]), Edges[3]));
// compute the scaled jacobian
OutType currSide, maxSide = vtkm::NegativeInfinity<OutType>();
vtkm::IdComponent edgeIndex, sideIndex;
for (edgeIndex = 0; edgeIndex < 6; edgeIndex++)
{
EdgesSquared[edgeIndex] = vtkm::MagnitudeSquared(Edges[edgeIndex]);
EdgesSquared[edgeIndex] = static_cast<OutType>(vtkm::MagnitudeSquared(Edges[edgeIndex]));
}
OutType Sides[4] = { EdgesSquared[0] * EdgesSquared[2] * EdgesSquared[3],
EdgesSquared[0] * EdgesSquared[1] * EdgesSquared[4],

@ -160,12 +160,12 @@ VTKM_EXEC OutType CellShapeMetric(const vtkm::IdComponent& numPts,
const Vector l3 = GetTetraL3<Scalar, Vector, CollectionOfPoints>(pts);
const Vector negl2 = -1 * l2;
const Scalar l0l0 = vtkm::Dot(l0, l0);
const Scalar l2l2 = vtkm::Dot(l2, l2);
const Scalar l3l3 = vtkm::Dot(l3, l3);
const Scalar l0negl2 = vtkm::Dot(l0, negl2);
const Scalar l0l3 = vtkm::Dot(l0, l3);
const Scalar negl2l3 = vtkm::Dot(negl2, l3);
const Scalar l0l0 = static_cast<Scalar>(vtkm::Dot(l0, l0));
const Scalar l2l2 = static_cast<Scalar>(vtkm::Dot(l2, l2));
const Scalar l3l3 = static_cast<Scalar>(vtkm::Dot(l3, l3));
const Scalar l0negl2 = static_cast<Scalar>(vtkm::Dot(l0, negl2));
const Scalar l0l3 = static_cast<Scalar>(vtkm::Dot(l0, l3));
const Scalar negl2l3 = static_cast<Scalar>(vtkm::Dot(negl2, l3));
const Scalar numerator = three * vtkm::Pow(jacobian * rtTwo, twoThirds);
Scalar denominator = (threeHalves * (l0l0 + l2l2 + l3l3)) - (l0negl2 + l0l3 + negl2l3);