Adding fixes to identify degenerate cells

This commit is contained in:
Abhishek Yenpure 2022-01-22 21:06:28 -08:00
parent 4556eed085
commit 16f15c94b9
2 changed files with 6 additions and 10 deletions

@ -101,6 +101,12 @@ VTKM_EXEC OutType CellMeasure(const vtkm::IdComponent& numPts,
pts[0] - pts[3],
};
if (vtkm::MagnitudeSquared(edges[0]) == OutType(0.0) ||
vtkm::MagnitudeSquared(edges[1]) == OutType(0.0) ||
vtkm::MagnitudeSquared(edges[2]) == OutType(0.0) ||
vtkm::MagnitudeSquared(edges[3]) == OutType(0.0))
return OutType(0.0);
typename PointCoordVecType::ComponentType cornerNormals[4] = {
Cross(edges[3], edges[0]),
Cross(edges[0], edges[1]),

@ -80,16 +80,6 @@ public:
const PointCoordVecType& pts,
OutType& metricValue) const
{
if (index == 2120)
{
std::cout << "Start Debug " << std::endl;
std::cout << "Num Points : " << numPoints << std::endl;
for (int i = 0; i < numPoints; i++)
{
std::cout << pts[i] << std::endl;
}
std::cout << "End Debug " << std::endl;
}
vtkm::UInt8 thisId = shape.Id;
if (shape.Id == vtkm::CELL_SHAPE_POLYGON)
{