Fix interpolation of cell fields with flying edges
The flying edges algorithm (used when contouring uniform structured cell sets) was not interpolating cell fields correctly. There was an indexing issue where a shortcut in the stepping was not incrementing the cell index.
This commit is contained in:
parent
7fa44ff4a8
commit
4f19ac6082
5
docs/changelog/flying-edges-cell-fields.md
Normal file
5
docs/changelog/flying-edges-cell-fields.md
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
# Fix interpolation of cell fields with flying edges
|
||||||
|
|
||||||
|
The flying edges algorithm (used when contouring uniform structured cell
|
||||||
|
sets) was not interpolating cell fields correctly. There was an indexing
|
||||||
|
issue where a shortcut in the stepping was not incrementing the cell index.
|
@ -28,15 +28,19 @@ VTKM_EXEC inline vtkm::Id3 compute_incs3d(const vtkm::Id3& dims)
|
|||||||
return vtkm::Id3{ 1, dims[0], (dims[0] * dims[1]) };
|
return vtkm::Id3{ 1, dims[0], (dims[0] * dims[1]) };
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_EXEC inline constexpr vtkm::Id increment_cellId(SumXAxis, vtkm::Id cellId, vtkm::Id)
|
VTKM_EXEC inline constexpr vtkm::Id increment_cellId(SumXAxis,
|
||||||
|
vtkm::Id cellId,
|
||||||
|
vtkm::Id,
|
||||||
|
vtkm::Id numToIncrement = 1)
|
||||||
{
|
{
|
||||||
return cellId + 1;
|
return cellId + numToIncrement;
|
||||||
}
|
}
|
||||||
VTKM_EXEC inline constexpr vtkm::Id increment_cellId(SumYAxis,
|
VTKM_EXEC inline constexpr vtkm::Id increment_cellId(SumYAxis,
|
||||||
vtkm::Id cellId,
|
vtkm::Id cellId,
|
||||||
vtkm::Id y_point_axis_inc)
|
vtkm::Id y_point_axis_inc,
|
||||||
|
vtkm::Id numToIncrement = 1)
|
||||||
{
|
{
|
||||||
return cellId + (y_point_axis_inc - 1);
|
return cellId + ((y_point_axis_inc - 1) * numToIncrement);
|
||||||
}
|
}
|
||||||
|
|
||||||
VTKM_EXEC inline bool case_includes_axes(vtkm::UInt8 const* const edgeUses)
|
VTKM_EXEC inline bool case_includes_axes(vtkm::UInt8 const* const edgeUses)
|
||||||
@ -159,6 +163,7 @@ struct Pass4TrimState
|
|||||||
cellId = compute_start(AxisToSum{}, ijk, pdims - vtkm::Id3{ 1, 1, 1 });
|
cellId = compute_start(AxisToSum{}, ijk, pdims - vtkm::Id3{ 1, 1, 1 });
|
||||||
|
|
||||||
//update our ijk
|
//update our ijk
|
||||||
|
cellId = increment_cellId(AxisToSum{}, cellId, axis_inc, left - ijk[AxisToSum::xindex]);
|
||||||
ijk[AxisToSum::xindex] = left;
|
ijk[AxisToSum::xindex] = left;
|
||||||
|
|
||||||
boundaryStatus[0] = FlyingEdges3D::Interior;
|
boundaryStatus[0] = FlyingEdges3D::Interior;
|
||||||
|
Loading…
Reference in New Issue
Block a user