122#ifndef Foam_vtk_vtuSizing_H
123#define Foam_vtk_vtuSizing_H
246 static void checkSizes
250 const label cellTypes_size,
251 const label vertLabels_size,
const label vertOffset_size,
252 const label faceLabels_size,
const label faceOffset_size,
255 const label polyFaceIds_size,
const label polyFaceOffset_size,
259 const label cellMap_size,
260 const label addPointsIds_size
265 template<
class LabelType>
266 static void populateArrays
283 template<
class LabelType>
284 static void populateArrays
329 const label numCells,
331 label beginOffset = 0
452 template<vtuSizing::slotType slot>
455 return sizeOf(output, slot);
499#undef declarePopulateInternalMethod
500#define declarePopulateInternalMethod(Type) \
503 void populateInternal \
505 const polyMesh& mesh, \
506 UList<uint8_t>& cellTypes, \
507 UList<Type>& connectivity, \
508 UList<Type>& offsets, \
509 UList<Type>& faces, \
510 UList<Type>& facesOffsets, \
511 foamVtkMeshMaps& maps, \
512 const enum contentType output \
516 void populateInternal \
518 const polyMesh& mesh, \
519 UList<uint8_t>& cellTypes, \
520 UList<Type>& connectivity, \
521 UList<Type>& offsets, \
522 UList<Type>& faces, \
523 UList<Type>& facesOffsets, \
524 labelUList& cellMap, \
525 labelUList& addPointsIds, \
526 const enum contentType output \
534 #undef declarePopulateInternalMethod
544 const label pointOffset,
552 const label pointOffset,
560 const label beginOffset,
586 const label pointOffset,
599 const label pointOffset,
612 const label beginOffset,
626 const label pointOffset
637 const label pointOffset
648 const label pointOffset
659 const label beginOffset
670 const label pointOffset
682 const label pointOffset
694 const label pointOffset
706 const label beginOffset
labelList faceLabels(nFaceLabels)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
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...
static labelList dummyFaceOffsets(const label numCells, const enum contentType output, label beginOffset=0)
Return a list of dummy faceOffsets.
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).
static labelList copyFaceOffsetsXml(const labelUList &faceOffsets, const label beginOffset)
Copy face offsets with an offset from previous - XML format.
static void renumberFaceLabels(labelUList &faceLabels, const label pointOffset, const contentType output)
Renumber faces stream labels by (global) point offset.
label sizeInternal1(slotType slot) const
The calculated size for vtk-internal storage of the specified slot.
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 output polyhedral cells for the mesh.
bool operator!=(const vtuSizing &rhs) const
Test inequality.
slotType
The possible storage 'slots' that can be used.
@ FACES
Polyhedral face-stream (XML, INTERNAL) or face vertices (HDF).
@ CELLS
Cell connectivity (ALL).
@ POLY_FACEIDS
Polyhedral face lookup (HDF only).
static labelList copyFaceLabelsXml(const labelUList &faceLabels, const label pointOffset)
Copy faces stream labels with a (global) point offset - XML format.
label nFacesPoly() const noexcept
Number of (non-unique) faces used by polyhedral cells.
void populateHdf(const polyMesh &mesh, UList< uint8_t > &cellTypes, labelUList &connectivity, labelUList &offsets, labelUList &faces, labelUList &facesOffsets, labelUList &polyFaceIds, labelUList &polyFaceOffsets, foamVtkMeshMaps &maps) const
Populate lists for HDF output.
selectionModeType selectionMode() const noexcept
Query how the mesh cells have been selected or defined.
static void renumberFaceOffsets(labelUList &faceOffsets, const label beginOffset, const contentType output)
Renumber face offsets with a specified (global) begin offset.
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 sizeInternal2(slotType slot) const
The calculated size for vtk-internal storage of the specified slot.
label nVertPoly() const noexcept
Number of vertex labels for polyhedral cells of the mesh.
void populateShapesLegacy(const UList< cellShape > &shapes, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
Reset list for primitive shapes only (ADVANCED USAGE).
contentType
Types of content that the storage may represent.
@ INTERNAL2
Internal vtkUnstructuredGrid content, VTK_CELL_ARRAY_V2.
@ HDF
Similar to INTERNAL2, but with VTKHDF specifics.
@ INTERNAL1
Internal vtkUnstructuredGrid content (old).
@ LEGACY
Legacy VTK content.
static labelList copyVertLabelsLegacy(const labelUList &connectivity, const label pointOffset)
Copy vertex labels with a (global) point offset - legacy format.
bool hasPolyCells() const noexcept
Has polyhedral cells?
static void renumberVertLabelsLegacy(labelUList &connectivity, const label pointOffset)
Renumber vertex labels by (global) point offset - legacy format.
label sizeOf(contentType output) const noexcept
Return the required size for the storage slot.
void reset(const polyMesh &mesh, const bool decompose=false)
Reset sizing by analyzing the mesh.
label nAddVerts() const noexcept
Number of additional (decomposed) vertices for the mesh.
void info(Ostream &os) const
Report some information.
label sizeXml(slotType slot) const
The calculated size for xml storage of the specified slot.
static void renumberFaceLabelsXml(labelUList &faceLabels, const label pointOffset)
Renumber faces stream labels by (global) point offset - XML format.
static labelList copyVertLabels(const labelUList &connectivity, const label pointOffset, const contentType output)
Copy vertex labels with a (global) point offset.
label nVertLabels() const noexcept
Number of vertex labels for the mesh.
static void renumberVertLabels(labelUList &connectivity, const label pointOffset, const contentType output)
Renumber vertex labels by (global) point offset.
label sizeOf(const enum contentType output, const enum slotType slot) const noexcept
Return the required size for the storage slot.
void setNumAddPoints(label n) noexcept
Alter number of additional (cell-centre) points (ADVANCED USAGE).
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, without any prefixing information.
selectionModeType
How the mesh cells have been selected or defined.
@ FULL_MESH
The entire mesh.
@ SHAPE_MESH
A limited subset of primitive shapes.
@ SUBSET_MESH
A mesh subset, using all mesh points.
static labelList copyVertLabelsXml(const labelUList &connectivity, const label pointOffset)
Copy vertex labels with a (global) point offset - XML format.
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.
static labelList copyFaceOffsets(const labelUList &faceOffsets, const label beginOffset, const contentType output)
Copy face offsets with a specified (global) begin offset.
static void renumberVertLabelsXml(labelUList &connectivity, const label pointOffset)
Renumber vertex labels by (global) point offset - XML format.
label nFieldCells() const noexcept
Number of field cells = nCells + nAddCells.
label sizeLegacy() const
The calculated size for legacy storage.
static labelList copyFaceLabels(const labelUList &faceLabels, const label pointOffset, const contentType output)
Copy faces stream labels with a (global) point offset.
static void renumberFaceOffsetsXml(labelUList &faceOffsets, const label beginOffset)
Renumber face offsets with a specified begin offset - XML format.
OBJstream os(runTime.globalPath()/outputName)
#define declarePopulateInternalMethod(Type)
Namespace for handling VTK output. Contains classes and functions for writing VTK file content.
List< label > labelList
A List of labels.
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
UList< label > labelUList
A UList of labels.
const labelUList & cellTypes
#define FOAM_DEPRECATED_FOR(since, replacement)