108#ifndef Foam_vtk_vtuSizing_H
109#define Foam_vtk_vtuSizing_H
218 static void checkSizes
222 const label cellTypes_size,
223 const label vertLabels_size,
224 const label vertOffset_size,
225 const label faceLabels_size,
226 const label faceOffset_size,
230 const label cellMap_size,
231 const label addPointsIds_size
235 template<
class LabelType>
236 static void adjustOffsets
241 const bool hasFaceStream
245 template<
class LabelType>
246 static void populateArrays
261 template<
class LabelType>
262 static void populateArrays
452#undef declarePopulateInternalMethod
453#define declarePopulateInternalMethod(Type) \
456 void populateInternal \
458 const polyMesh& mesh, \
459 UList<uint8_t>& cellTypes, \
460 UList<Type>& connectivity, \
461 UList<Type>& offsets, \
462 UList<Type>& faces, \
463 UList<Type>& facesOffsets, \
464 foamVtkMeshMaps& maps, \
465 const enum contentType output \
469 void populateInternal \
471 const polyMesh& mesh, \
472 UList<uint8_t>& cellTypes, \
473 UList<Type>& connectivity, \
474 UList<Type>& offsets, \
475 UList<Type>& faces, \
476 UList<Type>& facesOffsets, \
477 labelUList& cellMap, \
478 labelUList& addPointsIds, \
479 const enum contentType output \
487 #undef declarePopulateInternalMethod
497 const label globalPointOffset
504 const label globalPointOffset
511 const label globalPointOffset
518 const label prevOffset
525 const label globalPointOffset
532 const label globalPointOffset
539 const label globalPointOffset
546 const label prevOffset
553 void info(Ostream&
os)
const;
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
An analytical geometric cellShape.
Bookkeeping for mesh subsetting and/or polyhedral cell decomposition. Although the main use case is f...
Mesh consisting of general polyhedral cells.
Sizing descriptions and routines for transcribing an OpenFOAM volume mesh into a VTK unstructured gri...
label nAddCells() const noexcept
Number of additional (decomposed) cells for the mesh.
void clear() noexcept
Reset all sizes to zero.
vtuSizing() noexcept
Default construct.
void resetShapes(const UList< cellShape > &shapes)
Reset sizing using primitive shapes only (ADVANCED USAGE)
void setNumPoints(label n) noexcept
Alter number of mesh points (ADVANCED USAGE)
label sizeOf(const enum contentType output, const enum slotType slot) const
Return the required size for the storage slot.
static void renumberVertLabelsLegacy(labelUList &connectivity, const label globalPointOffset)
Renumber vertex labels by global point offset - legacy format.
label sizeLegacy() const
The calculated size for legacy storage.
void populateShapesXml(const UList< cellShape > &shapes, UList< uint8_t > &cellTypes, labelUList &connectivity, labelUList &offsets, labelUList &faces, labelUList &facesOffsets, foamVtkMeshMaps &maps) const
Reset list for primitive shapes only (ADVANCED USAGE)
label nCellsPoly() const noexcept
Number of polyhedral cells for the mesh.
bool operator!=(const vtuSizing &rhs) const
Test inequality.
static labelList copyFaceLabelsXml(const labelUList &faceLabels, const label globalPointOffset)
Copy faces stream labels with a global point offset - XML format.
selectionModeType selectionMode() const noexcept
Query how the mesh cells have been selected or defined.
static labelList copyFaceOffsetsXml(const labelUList &faceOffsets, const label prevOffset)
Copy face offsets with an offset from previous - XML format.
label nAddPoints() const noexcept
Number of additional (decomposed) points for the mesh.
bool decompose() const noexcept
Query the decompose flag (normally off)
bool manifold() const noexcept
Manifold mesh cells detected? Globally consistent quantity.
label nVertPoly() const noexcept
Number of vertex labels for polyhedral cells of the mesh.
static void renumberFaceLabelsXml(labelUList &faceLabels, const label globalPointOffset)
Renumber faces stream labels by global point offset - XML format.
void populateShapesLegacy(const UList< cellShape > &shapes, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
Reset list for primitive shapes only (ADVANCED USAGE)
slotType
The possible storage 'slots' that can be used.
@ 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.
@ LEGACY
Legacy VTK content.
@ INTERNAL2
Internal vtkUnstructuredGrid content, VTK_CELL_ARRAY_V2.
@ INTERNAL1
Internal vtkUnstructuredGrid content.
void reset(const polyMesh &mesh, const bool decompose=false)
Reset sizing by analyzing the mesh.
static labelList copyVertLabelsXml(const labelUList &connectivity, const label globalPointOffset)
Copy vertex labels with a global point offset - XML format.
label nAddVerts() const noexcept
Number of additional (decomposed) vertices for the mesh.
void info(Ostream &os) const
Report some information.
static void renumberFaceOffsetsXml(labelUList &faceOffsets, const label prevOffset)
Renumber face offsets with an offset from previous - XML format.
static labelList copyVertLabelsLegacy(const labelUList &connectivity, const label globalPointOffset)
Copy vertex labels with a global point offset - legacy format.
label sizeXml(const enum slotType slot) const
The calculated size for xml storage of the specified slot.
label nVertLabels() const noexcept
Number of vertex labels for the mesh.
label nPoints() const noexcept
Number of points for the mesh.
void setNumAddPoints(label n) noexcept
Alter number of additional (cell-centre) points (ADVANCED USAGE)
static void renumberVertLabelsXml(labelUList &connectivity, const label globalPointOffset)
Renumber vertex labels by global point offset - XML format.
label nFieldPoints() const noexcept
Number of field points = nPoints + nAddPoints.
label nCells() const noexcept
Number of cells for the mesh.
bool operator==(const vtuSizing &rhs) const
Test equality.
label nFaceLabels() const noexcept
Number of polyhedral face labels for the mesh.
void populateXml(const polyMesh &mesh, UList< uint8_t > &cellTypes, labelUList &connectivity, labelUList &offsets, labelUList &faces, labelUList &facesOffsets, foamVtkMeshMaps &maps) const
Populate lists for XML output.
void populateLegacy(const polyMesh &mesh, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
Populate lists for Legacy output.
selectionModeType
How the mesh cells have been selected or defined.
label nFieldCells() const noexcept
Number of field cells = nCells + nAddCells.
label sizeInternal1(const enum slotType slot) const
The calculated size for vtk-internal storage of the specified slot.
label sizeInternal2(const enum slotType slot) const
The calculated size for vtk-internal storage of the specified slot.
OBJstream os(runTime.globalPath()/outputName)
#define declarePopulateInternalMethod(Type)
List< label > labelList
A List of labels.
static Ostream & output(Ostream &os, const IntRange< T > &range)
UList< label > labelUList
A UList of labels.
const labelList & cellTypes