30inline vtkSmartPointer<vtkPoints>
37 auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
45 vtkpoints->SetNumberOfPoints(pts.
size() + addPoints.
size());
48 vtkIdType pointId = 0;
51 vtkpoints->SetPoint(pointId++,
p.v_);
55 for (
const label meshCelli : addPoints)
64inline vtkSmartPointer<vtkPoints>
72 auto vtkpoints = vtkSmartPointer<vtkPoints>::New();
78 const labelUList& addPoints = this->additionalIds();
80 vtkpoints->SetNumberOfPoints(pointMap.
size() + addPoints.
size());
83 vtkIdType pointId = 0;
84 for (
const label meshPointi : pointMap)
86 vtkpoints->SetPoint(pointId++, pts[meshPointi].v_);
90 for (
const label meshCelli : addPoints)
92 vtkpoints->SetPoint(pointId++,
mesh.cellCentres()[meshCelli].v_);
99inline vtkSmartPointer<vtkUnstructuredGrid>
103 const bool decompPoly
108 #ifdef VTK_CELL_ARRAY_V2
117 auto vtkmesh = vtkSmartPointer<vtkUnstructuredGrid>::New();
119 auto cellTypes = vtkSmartPointer<vtkUnsignedCharArray>::New();
126 auto cells = vtkSmartPointer<vtkCellArray>::New();
127 auto faces = vtkSmartPointer<vtkIdTypeArray>::New();
129 auto cellOffsets = vtkSmartPointer<vtkIdTypeArray>::New();
130 auto faceLocations = vtkSmartPointer<vtkIdTypeArray>::New();
146 #ifdef VTK_CELL_ARRAY_V2
148 auto cellConnect = vtkSmartPointer<vtkIdTypeArray>::New();
190 cellsUL, cellOffsetsUL,
191 facesUL, faceLocationsUL,
200 vtkmesh->SetPoints(this->
points(mesh));
202 #ifdef VTK_CELL_ARRAY_V2
205 cells->SetData(cellOffsets, cellConnect);
219 vtkmesh->SetCells(
cellTypes, cellOffsets,
cells, faceLocations, faces);
223 vtkmesh->SetCells(
cellTypes, cellOffsets,
cells,
nullptr,
nullptr);
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.
Mesh data needed to do the Finite Volume discretisation.
virtual const pointField & points() const
Return raw points.
const vectorField & cellCentres() const
Sizing descriptions and routines for transcribing an OpenFOAM volume mesh into a VTK unstructured gri...
label sizeOf(const enum contentType output, const enum slotType slot) const
Return the required size for the storage slot.
@ FACES_OFFSETS
Faces end-offsets (XML) or locations (INTERNAL1)
@ CELLS
Cell connectivity (ALL)
@ FACES
Face-stream (XML, INTERNAL)
contentType
Types of content that the storage may represent.
@ INTERNAL2
Internal vtkUnstructuredGrid content, VTK_CELL_ARRAY_V2.
@ INTERNAL1
Internal vtkUnstructuredGrid content.
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.
const wordList internal
Standard dimensioned field types (scalar, vector, tensor, etc)
static Ostream & output(Ostream &os, const IntRange< T > &range)
const labelList & cellTypes