mirror of
https://gitlab.kitware.com/vtk/vtk-m
synced 2024-09-20 02:55:47 +00:00
automatically build connectivity as needed.
This commit is contained in:
parent
407d1619d0
commit
11708c6ef7
@ -236,14 +236,14 @@ public:
|
||||
typename ExecutionTypes<Device,FromTopology,ToTopology>::ExecObjectType
|
||||
PrepareForInput(Device, FromTopology, ToTopology) const
|
||||
{
|
||||
this->BuildConnectivity(FromTopology(), ToTopology());
|
||||
|
||||
const typename
|
||||
ConnectivityChooser<FromTopology,ToTopology>::ConnectivityType
|
||||
&connectivity = this->GetConnectivity(FromTopology(), ToTopology());
|
||||
|
||||
VTKM_ASSERT_CONT(connectivity.ElementsValid);
|
||||
|
||||
connectivity.BuildIndexOffsets(Device());
|
||||
|
||||
typedef typename
|
||||
ExecutionTypes<Device,FromTopology,ToTopology>::ExecObjectType
|
||||
ExecObjType;
|
||||
@ -253,8 +253,35 @@ public:
|
||||
connectivity.IndexOffsets.PrepareForInput(Device()));
|
||||
}
|
||||
|
||||
void CreateCellToPointConnectivity()
|
||||
template<typename FromTopology, typename ToTopology>
|
||||
VTKM_CONT_EXPORT
|
||||
void BuildConnectivity(FromTopology, ToTopology) const
|
||||
{
|
||||
typedef CellSetExplicit<ShapeStorageTag,
|
||||
NumIndicesStorageTag,
|
||||
ConnectivityStorageTag> CSE;
|
||||
CSE *self = const_cast<CSE*>(this);
|
||||
|
||||
self->CreateConnectivity(FromTopology(), ToTopology());
|
||||
|
||||
self->GetConnectivity(FromTopology(), ToTopology()).
|
||||
BuildIndexOffsets(VTKM_DEFAULT_DEVICE_ADAPTER_TAG());
|
||||
}
|
||||
|
||||
VTKM_CONT_EXPORT
|
||||
void CreateConnectivity(vtkm::TopologyElementTagPoint,
|
||||
vtkm::TopologyElementTagCell)
|
||||
{
|
||||
// nothing to do
|
||||
}
|
||||
|
||||
VTKM_CONT_EXPORT
|
||||
void CreateConnectivity(vtkm::TopologyElementTagCell,
|
||||
vtkm::TopologyElementTagPoint)
|
||||
{
|
||||
if (this->CellToPoint.ElementsValid)
|
||||
return;
|
||||
|
||||
std::multimap<vtkm::Id,vtkm::Id> cells_of_nodes;
|
||||
|
||||
vtkm::Id maxNodeID = 0;
|
||||
|
@ -152,7 +152,6 @@ MakeTestDataSet::Make3DExplicitDataSet0()
|
||||
|
||||
vtkm::cont::CellSetExplicit<> cellSet(nVerts, "cells", 2);
|
||||
cellSet.FillViaCopy(shapes, numindices, conn);
|
||||
cellSet.CreateCellToPointConnectivity();
|
||||
|
||||
dataSet.AddCellSet(cellSet);
|
||||
|
||||
@ -192,8 +191,6 @@ MakeTestDataSet::Make3DExplicitDataSet1()
|
||||
cellSet.AddCell(vtkm::CELL_SHAPE_QUAD, 4, make_Vec<vtkm::Id>(2,1,3,4));
|
||||
cellSet.CompleteAddingCells();
|
||||
|
||||
cellSet.CreateCellToPointConnectivity();
|
||||
|
||||
dataSet.AddCellSet(cellSet);
|
||||
|
||||
return dataSet;
|
||||
@ -266,8 +263,6 @@ MakeTestDataSet::Make3DExplicitDataSetCowNose(double *pBounds)
|
||||
}
|
||||
cellSet.CompleteAddingCells();
|
||||
|
||||
cellSet.CreateCellToPointConnectivity();
|
||||
|
||||
dataSet.AddCellSet(cellSet);
|
||||
|
||||
// copy bounds
|
||||
|
Loading…
Reference in New Issue
Block a user