MCPcopy Create free account
hub / github.com/Kitware/VTK / BuildTopologyBufferToSend

Function BuildTopologyBufferToSend

Parallel/DIY/vtkDIYGhostUtilities.cxx:2765–2879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2763 */
2764template <class PointSetT>
2765void BuildTopologyBufferToSend(vtkIdList* seedPointIds,
2766 typename ::DataSetTypeToBlockTypeConverter<PointSetT>::BlockType ::InformationType& info,
2767 typename ::DataSetTypeToBlockTypeConverter<PointSetT>::BlockType ::BlockStructureType&
2768 blockStructure,
2769 int outputGhostLevels)
2770{
2771 vtkIdType maxPointId = 0;
2772
2773 PointSetT* input = info.Input;
2774
2775 std::set<vtkIdType> pointIdsToSend;
2776 std::set<vtkIdType> cellIdsToSend;
2777 vtkNew<vtkIdList> ids;
2778
2779 for (vtkIdType pointId = 0; pointId < seedPointIds->GetNumberOfIds(); ++pointId)
2780 {
2781 pointIdsToSend.insert(seedPointIds->GetId(pointId));
2782 }
2783
2784 std::set<vtkIdType> cellIdsToSendAtLastLevel;
2785 std::set<vtkIdType> pointIdsToSendAtLastLevel;
2786
2787 pointIdsToSendAtLastLevel.insert(pointIdsToSend.cbegin(), pointIdsToSend.cend());
2788
2789 vtkUnsignedCharArray* ghostCellArray = input->GetCellGhostArray();
2790
2791 // At each level, we look at the last chunk of point its that we added (starting with
2792 // seed points that are on the interface between us and the neighboring block).
2793 for (int ghostLevel = 0; ghostLevel < outputGhostLevels; ++ghostLevel)
2794 {
2795 std::set<vtkIdType> cellIdsToSendAtThisLevel;
2796 std::set<vtkIdType> pointIdsToSendAtThisLevel;
2797
2798 // For each point in this chunk of points, we look at every cells that use this point.
2799 // If the found cell has already been added as a cell to send, we skip. If not, we add it as a
2800 // cell to send.
2801 for (const vtkIdType& pointId : pointIdsToSendAtLastLevel)
2802 {
2803 input->GetPointCells(pointId, ids);
2804 for (vtkIdType id = 0; id < ids->GetNumberOfIds(); ++id)
2805 {
2806 vtkIdType cellIdToSend = ids->GetId(id);
2807 if ((!ghostCellArray ||
2808 !(ghostCellArray->GetValue(cellIdToSend) &
2809 ::GHOST_CELL_TO_PEEL_IN_UNSTRUCTURED_DATA)) &&
2810 !cellIdsToSend.count(cellIdToSend))
2811 {
2812 cellIdsToSendAtThisLevel.insert(cellIdToSend);
2813 cellIdsToSend.insert(cellIdToSend);
2814
2815 ::UpdateCellBufferSize<PointSetT>(cellIdToSend, info, blockStructure);
2816 }
2817 }
2818 }
2819
2820 // For each cells that we want to send at this level, we look at all points composing them, and
2821 // we add any point that has never been processed in the previous scope into the new chunk of
2822 // points.

Callers

nothing calls this directly

Calls 15

GetCellGhostArrayMethod · 0.80
SetNumberOfIdsMethod · 0.80
maxFunction · 0.50
swapFunction · 0.50
TransformFunction · 0.50
GetNumberOfIdsMethod · 0.45
insertMethod · 0.45
GetIdMethod · 0.45
cbeginMethod · 0.45
cendMethod · 0.45

Tested by

no test coverage detected