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);
464 const polyMesh&
mesh,
467 foamVtkMeshMaps& maps
473 const polyMesh&
mesh,
479 foamVtkMeshMaps& maps
485 const polyMesh&
mesh,
493 foamVtkMeshMaps& maps
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
vtuSizing() noexcept
Default construct.
static void renumberVertLabelsXml(labelUList &connectivity, const label pointOffset)
Renumber vertex labels by (global) point offset - XML format.
label nFacesPoly() const noexcept
Number of (non-unique) faces used by polyhedral cells.
void populateShapesLegacy(const UList< cellShape > &shapes, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
Reset list for primitive shapes only (ADVANCED USAGE)
static labelList copyVertLabels(const labelUList &connectivity, const label pointOffset, const contentType output)
Copy vertex labels with a (global) point offset.
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.
label nVertLabels() const noexcept
Number of vertex labels for the mesh.
A mesh subset, using all mesh points.
bool operator==(const vtuSizing &rhs) const
Test equality.
label nAddVerts() const noexcept
Number of additional (decomposed) vertices for the mesh.
void populateLegacy(const polyMesh &mesh, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
Populate lists for Legacy output.
An analytical geometric cellShape.
void reset(const polyMesh &mesh, const bool decompose=false)
Reset sizing by analyzing the mesh.
bool decompose() const noexcept
Query the decompose flag (normally off)
label nVertPoly() const noexcept
Number of vertex labels for polyhedral cells of the mesh.
#define declarePopulateInternalMethod(Type)
label nFaceLabels() const noexcept
Number of polyhedral face labels for the mesh, without any prefixing information. ...
Similar to INTERNAL2, but with VTKHDF specifics.
static labelList copyFaceOffsetsXml(const labelUList &faceOffsets, const label beginOffset)
Copy face offsets with an offset from previous - XML format.
static void renumberFaceLabelsXml(labelUList &faceLabels, const label pointOffset)
Renumber faces stream labels by (global) point offset - XML format.
label sizeOf(const enum contentType output, const enum slotType slot) const noexcept
Return the required size for the storage slot.
label nFieldPoints() const noexcept
Number of field points = nPoints + nAddPoints.
labelList faceLabels(nFaceLabels)
static void renumberFaceLabels(labelUList &faceLabels, const label pointOffset, const contentType output)
Renumber faces stream labels by (global) point offset.
static void renumberVertLabelsLegacy(labelUList &connectivity, const label pointOffset)
Renumber vertex labels by (global) point offset - legacy format.
Bookkeeping for mesh subsetting and/or polyhedral cell decomposition. Although the main use case is f...
UList< label > labelUList
A UList of labels.
class FOAM_DEPRECATED_FOR(2017-05, "Foam::Enum") NamedEnum
void rhs(fvMatrix< typename Expr::value_type > &m, const Expr &expression)
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 sizeInternal2(slotType slot) const
The calculated size for vtk-internal storage of the specified slot.
static labelList copyFaceLabelsXml(const labelUList &faceLabels, const label pointOffset)
Copy faces stream labels with a (global) point offset - XML format.
bool operator!=(const vtuSizing &rhs) const
Test inequality.
void setNumPoints(label n) noexcept
Alter number of mesh points (ADVANCED USAGE)
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.
static labelList copyVertLabelsXml(const labelUList &connectivity, const label pointOffset)
Copy vertex labels with a (global) point offset - XML format.
slotType
The possible storage 'slots' that can be used.
A limited subset of primitive shapes.
void info(Ostream &os) const
Report some information.
static labelList dummyFaceOffsets(const label numCells, const enum contentType output, label beginOffset=0)
Return a list of dummy faceOffsets.
Polyhedral face lookup (HDF only)
label nAddPoints() const noexcept
Number of additional (decomposed) points for the mesh.
const labelUList & cellTypes
contentType
Types of content that the storage may represent.
Internal vtkUnstructuredGrid content (old)
selectionModeType
How the mesh cells have been selected or defined.
label nCells() const noexcept
Number of cells for the mesh.
bool manifold() const noexcept
Manifold mesh cells detected? Globally consistent quantity.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
static labelList copyVertLabelsLegacy(const labelUList &connectivity, const label pointOffset)
Copy vertex labels with a (global) point offset - legacy format.
An Ostream is an abstract base class for all output systems (streams, files, token lists...
OBJstream os(runTime.globalPath()/outputName)
Internal vtkUnstructuredGrid content, VTK_CELL_ARRAY_V2.
label sizeXml(slotType slot) const
The calculated size for xml storage of the specified slot.
bool hasPolyCells() const noexcept
Has polyhedral cells?
label nFieldCells() const noexcept
Number of field cells = nCells + nAddCells.
Polyhedral face-stream (XML, INTERNAL) or face vertices (HDF)
static labelList copyFaceLabels(const labelUList &faceLabels, const label pointOffset, const contentType output)
Copy faces stream labels with a (global) point offset.
Sizing descriptions and routines for transcribing an OpenFOAM volume mesh into a VTK unstructured gri...
label nPoints() const noexcept
Number of points for the mesh.
label sizeLegacy() const
The calculated size for legacy storage.
static void renumberFaceOffsets(labelUList &faceOffsets, const label beginOffset, const contentType output)
Renumber face offsets with a specified (global) begin offset.
label nAddCells() const noexcept
Number of additional (decomposed) cells for the mesh.
label sizeInternal1(slotType slot) const
The calculated size for vtk-internal storage of the specified slot.
static void renumberFaceOffsetsXml(labelUList &faceOffsets, const label beginOffset)
Renumber face offsets with a specified begin offset - XML format.
label nCellsPoly() const noexcept
Number of output polyhedral cells for the mesh.
selectionModeType selectionMode() const noexcept
Query how the mesh cells have been selected or defined.
Mesh consisting of general polyhedral cells.
void clear() noexcept
Reset all sizes to zero.
static void renumberVertLabels(labelUList &connectivity, const label pointOffset, const contentType output)
Renumber vertex labels by (global) point offset.
List< label > labelList
A List of labels.
void resetShapes(const UList< cellShape > &shapes)
Reset sizing using primitive shapes only (ADVANCED USAGE)
void setNumAddPoints(label n) noexcept
Alter number of additional (cell-centre) points (ADVANCED USAGE)
static labelList copyFaceOffsets(const labelUList &faceOffsets, const label beginOffset, const contentType output)
Copy face offsets with a specified (global) begin offset.