30inline vtkSmartPointer<vtkPoints>
36 auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
45 vtkpoints->SetNumberOfPoints(count);
51inline vtkSmartPointer<vtkPoints>
62 const auto&
pts =
mesh.points();
63 const auto& cc =
mesh.cellCentres();
66 const labelUList& addPoints = this->additionalIds();
68 auto vtkpoints = NewPoints(
pts.size() + addPoints.
size());
71 vtkIdType pointId = 0;
74 vtkpoints->SetPoint(pointId++,
p.cdata());
78 for (
const label celli : addPoints)
80 const auto&
p = cc[celli];
81 vtkpoints->SetPoint(pointId++,
p.cdata());
88inline vtkSmartPointer<vtkPoints>
100 const auto&
pts =
mesh.points();
101 const auto& cc =
mesh.cellCentres();
104 const labelUList& addPoints = this->additionalIds();
106 auto vtkpoints = NewPoints(pointMap.
size() + addPoints.
size());
109 vtkIdType pointId = 0;
110 for (
const label pointi : pointMap)
112 const auto&
p =
pts[pointi];
113 vtkpoints->SetPoint(pointId++,
p.cdata());
117 for (
const label celli : addPoints)
119 const auto&
p = cc[celli];
120 vtkpoints->SetPoint(pointId++,
p.cdata());
127inline vtkSmartPointer<vtkUnstructuredGrid>
131 const bool decompPoly
136 #ifdef VTK_CELL_ARRAY_V2
145 auto vtkmesh = vtkSmartPointer<vtkUnstructuredGrid>::New();
147 auto cellTypes = vtkSmartPointer<vtkUnsignedCharArray>::New();
154 auto cells = vtkSmartPointer<vtkCellArray>::New();
155 auto faces = vtkSmartPointer<vtkIdTypeArray>::New();
157 auto cellOffsets = vtkSmartPointer<vtkIdTypeArray>::New();
158 auto faceLocations = vtkSmartPointer<vtkIdTypeArray>::New();
174 #ifdef VTK_CELL_ARRAY_V2
176 auto cellConnect = vtkSmartPointer<vtkIdTypeArray>::New();
218 cellsUL, cellOffsetsUL,
219 facesUL, faceLocationsUL,
228 vtkmesh->SetPoints(this->
points(mesh));
230 #ifdef VTK_CELL_ARRAY_V2
233 cells->SetData(cellOffsets, cellConnect);
251 vtkmesh->SetCells(
cellTypes, cellOffsets,
cells, faceLocations, faces);
255 vtkmesh->SetCells(
cellTypes, cellOffsets,
cells,
nullptr,
nullptr);
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void size(const label n)
Older name for setAddressableSize.
Bookkeeping for mesh subsetting and/or polyhedral cell decomposition. Although the main use case is f...
const labelList & additionalIds() const noexcept
Any additional (user) labels.
foamVtkMeshMaps()=default
Default construct: zero-sized, no reserved sizes.
const labelList & pointMap() const noexcept
Point labels for subsetted meshes.
Mesh data needed to do the Finite Volume discretisation.
Mesh consisting of general polyhedral cells.
vtkSmartPointer< vtkPoints > NewPoints(vtkIdType count) const
Allocate vtkPoints.
vtkSmartPointer< vtkUnstructuredGrid > internal(const fvMesh &mesh, const bool decompPoly=false)
Internal mesh as vtkUnstructuredGrid.
vtkSmartPointer< vtkPoints > points(const polyMesh &mesh) const
The vtk points for the mesh (and decomposition).
Sizing descriptions and routines for transcribing an OpenFOAM volume mesh into a VTK unstructured gri...
@ FACES
Polyhedral face-stream (XML, INTERNAL) or face vertices (HDF).
@ CELLS
Cell connectivity (ALL).
contentType
Types of content that the storage may represent.
@ INTERNAL2
Internal vtkUnstructuredGrid content, VTK_CELL_ARRAY_V2.
@ INTERNAL1
Internal vtkUnstructuredGrid content (old).
label sizeOf(const enum contentType output, const enum slotType slot) const noexcept
Return the required size for the storage slot.
void populateInternal(const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< int > &connectivity, UList< int > &offsets, UList< int > &faces, UList< int > &facesOffsets, foamVtkMeshMaps &maps, const enum contentType output) const
Populate lists for Internal VTK format.
label nFieldCells() const noexcept
Number of field cells = nCells + nAddCells.
vector point
Point is a vector.
UList< label > labelUList
A UList of labels.
const labelUList & cellTypes