MCPcopy Create free account
hub / github.com/Kitware/ParaView / BuildVTKGrid

Function BuildVTKGrid

Examples/Catalyst/MPISubCommunicatorExample/FEAdaptor.cxx:28–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

26vtkMPICommunicatorOpaqueComm* Comm = nullptr;
27
28void BuildVTKGrid(Grid& grid)
29{
30 // create the points information
31 vtkNew<vtkDoubleArray> pointArray;
32 pointArray->SetNumberOfComponents(3);
33 pointArray->SetArray(
34 grid.GetPointsArray(), static_cast<vtkIdType>(grid.GetNumberOfPoints() * 3), 1);
35 vtkNew<vtkPoints> points;
36 points->SetData(pointArray);
37 VTKGrid->SetPoints(points);
38
39 // create the cells
40 size_t numCells = grid.GetNumberOfCells();
41 VTKGrid->Allocate(static_cast<vtkIdType>(numCells * 9));
42 for (size_t cell = 0; cell < numCells; cell++)
43 {
44 unsigned int* cellPoints = grid.GetCellPoints(cell);
45 vtkIdType tmp[8] = { cellPoints[0], cellPoints[1], cellPoints[2], cellPoints[3], cellPoints[4],
46 cellPoints[5], cellPoints[6], cellPoints[7] };
47 VTKGrid->InsertNextCell(VTK_HEXAHEDRON, 8, tmp);
48 }
49}
50
51void UpdateVTKAttributes(Grid& grid, Attributes& attributes, vtkCPInputDataDescription* idd)
52{

Callers 1

BuildVTKDataStructuresFunction · 0.70

Calls 9

SetPointsMethod · 0.80
InsertNextCellMethod · 0.80
SetNumberOfComponentsMethod · 0.45
GetPointsArrayMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetDataMethod · 0.45
GetNumberOfCellsMethod · 0.45
AllocateMethod · 0.45
GetCellPointsMethod · 0.45

Tested by

no test coverage detected