Commit f8eb8287 authored by Andrew Bauer's avatar Andrew Bauer
Browse files

WIP: Adding print statements to show issues with filter

parent ee057ded
......@@ -1343,8 +1343,6 @@ void vtkCellTypeSource::GenerateLagrangeCurves(vtkUnstructuredGrid* output, int
vtkIdType numberOfPoints = points->GetNumberOfPoints();
// cell dimensions
const int xDim = extent[1] - extent[0];
// const int yDim = extent[3]-extent[2];
// const int zDim = extent[5]-extent[4];
// Connectivity size = (numCells = xDim * (numPtsPerCell = (order + 1) + /* conn size */ 1))
output->Allocate(xDim * (this->CellOrder + 2));
// output->Allocate(numberOfPoints-1);
......@@ -1375,7 +1373,7 @@ void vtkCellTypeSource::GenerateLagrangeTris(vtkUnstructuredGrid* output, int ex
// cell dimensions
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int numCells = (xDim - 1) * (yDim - 1) * 2; // 2 tris per quad
const int numCells = xDim * yDim * 2; // 2 tris per block
const int order = this->CellOrder;
const int numPtsPerCell = ((order + 1) * (order + 2) / 2) +
((order == 2 && this->CompleteQuadraticSimplicialElements) ? 1 : 0);
......@@ -1461,7 +1459,7 @@ void vtkCellTypeSource::GenerateLagrangeQuads(vtkUnstructuredGrid* output, int e
// cell dimensions
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int numCells = (xDim - 1) * (yDim - 1);
const int numCells = xDim * yDim;
const int numPtsPerCell = (this->CellOrder + 1) * (this->CellOrder + 1);
// Connectivity size = numCells * (numPtsPerCell + 1))
// numPtsPerCell + 1 because conn doesn't hold number of pts per cell, but output cell array does.
......@@ -1526,7 +1524,7 @@ void vtkCellTypeSource::GenerateLagrangeTets(vtkUnstructuredGrid* output, int ex
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int zDim = extent[5] - extent[4];
const int numCells = (xDim - 1) * (yDim - 1) * (zDim - 1);
const int numCells = xDim * yDim * zDim * 5; // 5 tets per block
const int numPtsPerCell = (this->CellOrder == 2 && this->CompleteQuadraticSimplicialElements)
? 15
: (this->CellOrder + 1) * (this->CellOrder + 2) * (this->CellOrder + 3) / 6;
......@@ -1632,7 +1630,7 @@ void vtkCellTypeSource::GenerateLagrangeHexes(vtkUnstructuredGrid* output, int e
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int zDim = extent[5] - extent[4];
const int numCells = (xDim - 1) * (yDim - 1) * (zDim - 1);
const int numCells = xDim * yDim * zDim;
const int numPtsPerCell = (this->CellOrder + 1) * (this->CellOrder + 1) * (this->CellOrder + 1);
// Connectivity size = numCells * (numPtsPerCell + 1))
// numPtsPerCell + 1 because conn doesn't hold number of pts per cell, but output cell array does.
......@@ -1702,11 +1700,12 @@ void vtkCellTypeSource::GenerateLagrangeWedges(vtkUnstructuredGrid* output, int
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int zDim = extent[5] - extent[4];
const int numCells = (xDim - 1) * (yDim - 1) * (zDim - 1) * 2; // 2 wedges per hex
const int numCells = xDim * yDim * zDim * 2; // 2 wedges per block
const int numPtsPerCell = (this->CompleteQuadraticSimplicialElements && this->CellOrder == 2)
? 21
: (this->CellOrder + 1) * (this->CellOrder + 1) * (this->CellOrder + 2) / 2;
// There is some ambiguity about whether or not <order> should be a 3-array
// containing the order in each cardinal direction or a 4-array that
// additionally holds the number of points. Since
......@@ -1777,13 +1776,27 @@ void vtkCellTypeSource::GenerateLagrangeWedges(vtkUnstructuredGrid* output, int
if (m + n <= order[0])
{
int ctaidx = vtkLagrangeWedge::PointIndexFromIJK(m, n, p, order);
cta[ctaidx] = innerPointId;
if (ctaidx >= 0 || ctaidx < cta.size())
{
cta[ctaidx] = innerPointId;
}
else
{
cerr << "this is wrong " << ctaidx << " " << cta.size() << endl;
}
}
if (m + n >= order[0])
{
int ctbidx =
vtkLagrangeWedge::PointIndexFromIJK(order[0] - m, order[0] - n, p, order);
ctb[ctbidx] = innerPointId;
if (ctbidx >= 0 || ctbidx < ctb.size())
{
ctb[ctbidx] = innerPointId;
}
else
{
cerr << "this is wrong " << ctbidx << " " << ctb.size() << endl;
}
}
}
}
......@@ -1871,7 +1884,7 @@ void vtkCellTypeSource::GenerateBezierTris(vtkUnstructuredGrid* output, int exte
// cell dimensions
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int numCells = (xDim - 1) * (yDim - 1) * 2; // 2 tris per quad
const int numCells = xDim * yDim * 2; // 2 tris per block
const int order = this->CellOrder;
const int numPtsPerCell = ((order + 1) * (order + 2) / 2) +
((order == 2 && this->CompleteQuadraticSimplicialElements) ? 1 : 0);
......@@ -1957,7 +1970,7 @@ void vtkCellTypeSource::GenerateBezierQuads(vtkUnstructuredGrid* output, int ext
// cell dimensions
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int numCells = (xDim - 1) * (yDim - 1);
const int numCells = xDim * yDim;
const int numPtsPerCell = (this->CellOrder + 1) * (this->CellOrder + 1);
// Connectivity size = numCells * (numPtsPerCell + 1))
// numPtsPerCell + 1 because conn doesn't hold number of pts per cell, but output cell array does.
......@@ -2022,7 +2035,7 @@ void vtkCellTypeSource::GenerateBezierTets(vtkUnstructuredGrid* output, int exte
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int zDim = extent[5] - extent[4];
const int numCells = (xDim - 1) * (yDim - 1) * (zDim - 1);
const int numCells = xDim * yDim * zDim * 5; // 5 tets per block
const int numPtsPerCell = (this->CellOrder == 2 && this->CompleteQuadraticSimplicialElements)
? 15
: (this->CellOrder + 1) * (this->CellOrder + 2) * (this->CellOrder + 3) / 6;
......@@ -2128,7 +2141,7 @@ void vtkCellTypeSource::GenerateBezierHexes(vtkUnstructuredGrid* output, int ext
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int zDim = extent[5] - extent[4];
const int numCells = (xDim - 1) * (yDim - 1) * (zDim - 1);
const int numCells = xDim * yDim * zDim;
const int numPtsPerCell = (this->CellOrder + 1) * (this->CellOrder + 1) * (this->CellOrder + 1);
// Connectivity size = numCells * (numPtsPerCell + 1))
// numPtsPerCell + 1 because conn doesn't hold number of pts per cell, but output cell array does.
......@@ -2198,7 +2211,7 @@ void vtkCellTypeSource::GenerateBezierWedges(vtkUnstructuredGrid* output, int ex
const int xDim = extent[1] - extent[0];
const int yDim = extent[3] - extent[2];
const int zDim = extent[5] - extent[4];
const int numCells = (xDim - 1) * (yDim - 1) * (zDim - 1) * 2; // 2 wedges per hex
const int numCells = xDim * yDim * zDim * 2; // 2 wedges per block
const int numPtsPerCell = (this->CompleteQuadraticSimplicialElements && this->CellOrder == 2)
? 21
: (this->CellOrder + 1) * (this->CellOrder + 1) * (this->CellOrder + 2) / 2;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment