mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-08 13:23:51 +00:00
Remove unneeded methods from the Connectivity classes.
This commit is contained in:
parent
b56f160434
commit
6da48cf3c1
@ -45,8 +45,8 @@ struct TestKernel : public vtkm::exec::FunctorBase
|
||||
this->RaiseError("Got bad number of shapes in exec cellset object.");
|
||||
}
|
||||
|
||||
if (this->CellSet.GetNumberOfIndices(0) != 3 ||
|
||||
this->CellSet.GetNumberOfIndices(1) != 4 )
|
||||
if (this->CellSet.GetIndices(0).GetNumberOfComponents() != 3 ||
|
||||
this->CellSet.GetIndices(1).GetNumberOfComponents() != 4 )
|
||||
{
|
||||
this->RaiseError("Got bad number of Indices in exec cellset object.");
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ template<typename ShapePortalType,
|
||||
class ConnectivityExplicit
|
||||
{
|
||||
public:
|
||||
typedef typename vtkm::Id SchedulingRangeType;
|
||||
|
||||
ConnectivityExplicit() {}
|
||||
|
||||
ConnectivityExplicit(const ShapePortalType& shapePortal,
|
||||
@ -52,17 +54,11 @@ public:
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
vtkm::Id GetNumberOfElements() const
|
||||
SchedulingRangeType GetNumberOfElements() const
|
||||
{
|
||||
return this->Shapes.GetNumberOfValues();
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
vtkm::IdComponent GetNumberOfIndices(vtkm::Id index) const
|
||||
{
|
||||
return static_cast<vtkm::IdComponent>(this->NumIndices.Get(index));
|
||||
}
|
||||
|
||||
typedef vtkm::CellShapeTagGeneric CellShapeTag;
|
||||
|
||||
VTKM_EXEC
|
||||
@ -82,7 +78,7 @@ public:
|
||||
IndicesType GetIndices(vtkm::Id index) const
|
||||
{
|
||||
vtkm::Id offset = this->IndexOffset.Get(index);
|
||||
vtkm::IdComponent length = this->GetNumberOfIndices(index);
|
||||
vtkm::IdComponent length = this->NumIndices.Get(index);
|
||||
return IndicesType(this->Connectivity, length, offset);
|
||||
}
|
||||
|
||||
|
@ -34,7 +34,7 @@ template<typename PermutationPortal,
|
||||
class ConnectivityPermuted
|
||||
{
|
||||
public:
|
||||
typedef vtkm::Id SchedulingRangeType;
|
||||
typedef typename OriginalConnectivity::SchedulingRangeType SchedulingRangeType;
|
||||
|
||||
VTKM_SUPPRESS_EXEC_WARNINGS
|
||||
VTKM_EXEC_CONT
|
||||
@ -60,12 +60,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
VTKM_EXEC
|
||||
vtkm::IdComponent GetNumberOfIndices(vtkm::Id index) const {
|
||||
return this->Connectivity.GetNumberOfIndices( this->Portal.Get(index) );
|
||||
}
|
||||
|
||||
|
||||
typedef typename OriginalConnectivity::CellShapeTag CellShapeTag;
|
||||
|
||||
VTKM_EXEC
|
||||
@ -76,13 +70,13 @@ public:
|
||||
|
||||
typedef typename OriginalConnectivity::IndicesType IndicesType;
|
||||
|
||||
template<typename IndexType>
|
||||
VTKM_EXEC
|
||||
IndicesType GetIndices(vtkm::Id index) const
|
||||
IndicesType GetIndices(const IndexType &index) const
|
||||
{
|
||||
return this->Connectivity.GetIndices( this->Portal.Get(index) );
|
||||
}
|
||||
|
||||
private:
|
||||
PermutationPortal Portal;
|
||||
OriginalConnectivity Connectivity;
|
||||
};
|
||||
|
@ -64,12 +64,6 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
template<typename IndexType>
|
||||
VTKM_EXEC
|
||||
vtkm::IdComponent GetNumberOfIndices(const IndexType &index) const {
|
||||
return Helper::GetNumberOfIndices(this->Internals, index);
|
||||
}
|
||||
|
||||
// This needs some thought. What does cell shape mean when the to topology
|
||||
// is not a cell?
|
||||
typedef typename InternalsType::CellShapeTag CellShapeTag;
|
||||
|
@ -92,14 +92,6 @@ public:
|
||||
return pointIds;
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::IdComponent GetNumberOfCellsIncidentOnPoint(vtkm::Id pointIndex) const
|
||||
{
|
||||
return
|
||||
(static_cast<vtkm::IdComponent>(pointIndex > 0)
|
||||
+ static_cast<vtkm::IdComponent>(pointIndex < this->PointDimensions-1));
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::VecVariable<vtkm::Id,MAX_CELL_TO_POINT>
|
||||
GetCellsOfPoint(vtkm::Id index) const
|
||||
@ -226,25 +218,6 @@ public:
|
||||
return this->GetPointsOfCell(this->FlatToLogicalCellIndex(cellIndex));
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::IdComponent
|
||||
GetNumberOfCellsIncidentOnPoint(const SchedulingRangeType &ij) const
|
||||
{
|
||||
return
|
||||
(static_cast<vtkm::IdComponent>((ij[0] > 0) && (ij[1] > 0))
|
||||
+ static_cast<vtkm::IdComponent>((ij[0] < this->PointDimensions[0]-1) && (ij[1] > 0))
|
||||
+ static_cast<vtkm::IdComponent>((ij[0] > 0) && (ij[1] < this->PointDimensions[1]-1))
|
||||
+ static_cast<vtkm::IdComponent>(
|
||||
(ij[0] < this->PointDimensions[0]-1) && (ij[1] < this->PointDimensions[1]-1)));
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::IdComponent GetNumberOfCellsIncidentOnPoint(vtkm::Id pointIndex) const
|
||||
{
|
||||
return this->GetNumberOfCellsIncidentOnPoint(
|
||||
this->FlatToLogicalPointIndex(pointIndex));
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::VecVariable<vtkm::Id,MAX_CELL_TO_POINT>
|
||||
GetCellsOfPoint(const SchedulingRangeType &ij) const
|
||||
@ -406,37 +379,6 @@ public:
|
||||
return this->GetPointsOfCell(this->FlatToLogicalCellIndex(cellIndex));
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::IdComponent
|
||||
GetNumberOfCellsIncidentOnPoint(const SchedulingRangeType &ijk) const
|
||||
{
|
||||
return (
|
||||
static_cast<vtkm::IdComponent>((ijk[0] > 0) && (ijk[1] > 0) && (ijk[2] > 0))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] < this->PointDimensions[0]-1) && (ijk[1] > 0) && (ijk[2] > 0))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] > 0) && (ijk[1] < this->PointDimensions[1]-1) && (ijk[2] > 0))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] < this->PointDimensions[0]-1) &&
|
||||
(ijk[1] < this->PointDimensions[1]-1) &&
|
||||
(ijk[2] > 0))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] > 0) && (ijk[1] > 0) && (ijk[2] < this->PointDimensions[2]-1))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] < this->PointDimensions[0]-1) &&
|
||||
(ijk[1] > 0) &&
|
||||
(ijk[2] < this->PointDimensions[2]-1))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] > 0) &&
|
||||
(ijk[1] < this->PointDimensions[1]-1) &&
|
||||
(ijk[2] < this->PointDimensions[2]-1))
|
||||
+ static_cast<vtkm::IdComponent>((ijk[0] < this->PointDimensions[0]-1) &&
|
||||
(ijk[1] < this->PointDimensions[1]-1) &&
|
||||
(ijk[2] < this->PointDimensions[2]-1))
|
||||
);
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::IdComponent GetNumberOfCellsIncidentOnPoint(vtkm::Id pointIndex) const
|
||||
{
|
||||
return this->GetNumberOfCellsIncidentOnPoint(
|
||||
this->FlatToLogicalPointIndex(pointIndex));
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
vtkm::VecVariable<vtkm::Id,MAX_CELL_TO_POINT>
|
||||
GetCellsOfPoint(const SchedulingRangeType &ijk) const
|
||||
@ -578,15 +520,6 @@ struct ConnectivityStructuredIndexHelper<
|
||||
return connectivity.GetPointsOfCell(cellIndex);
|
||||
}
|
||||
|
||||
template<typename IndexType>
|
||||
VTKM_EXEC_CONT
|
||||
static vtkm::IdComponent GetNumberOfIndices(
|
||||
const ConnectivityType &connectivity,
|
||||
const IndexType &vtkmNotUsed(cellIndex))
|
||||
{
|
||||
return connectivity.GetNumberOfPointsInCell();
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
static LogicalIndexType
|
||||
FlatToLogicalFromIndex(const ConnectivityType &connectivity,
|
||||
@ -639,15 +572,6 @@ struct ConnectivityStructuredIndexHelper<
|
||||
return connectivity.GetCellsOfPoint(pointIndex);
|
||||
}
|
||||
|
||||
template<typename IndexType>
|
||||
VTKM_EXEC_CONT
|
||||
static vtkm::IdComponent GetNumberOfIndices(
|
||||
const ConnectivityType &connectivity,
|
||||
const IndexType &pointIndex)
|
||||
{
|
||||
return connectivity.GetNumberOfCellsIncidentOnPoint(pointIndex);
|
||||
}
|
||||
|
||||
VTKM_EXEC_CONT
|
||||
static LogicalIndexType
|
||||
FlatToLogicalFromIndex(const ConnectivityType &connectivity,
|
||||
|
Loading…
Reference in New Issue
Block a user