vtuCells Class Reference

A deep-copy description of an OpenFOAM volume mesh in data structures suitable for VTK UnstructuredGrid, including the possibility of decomposing polyhedral cells into primitive cell types. More...

Inheritance diagram for vtuCells:
[legend]
Collaboration diagram for vtuCells:
[legend]

Public Member Functions

 vtuCells (const enum contentType output=contentType::XML, const bool decompose=false)
 Default construct (XML format, no polyhedral decomposition) More...
 
 vtuCells (const polyMesh &mesh, const enum contentType output=contentType::XML, const bool decompose=false)
 Construct from components, create output information immediately. More...
 
 vtuCells (const vtk::outputOptions opts, const bool decompose=false)
 Construct from components. More...
 
 vtuCells (const polyMesh &mesh, const vtk::outputOptions opts, const bool decompose=false)
 Construct from components, create output information immediately. More...
 
enum contentType content () const
 The output content type. More...
 
bool decomposeRequested () const
 Query the polyhedral decompose requested flag. More...
 
bool empty () const noexcept
 True if no cellTypes are populated. More...
 
label size () const noexcept
 The size of populated cellTypes. More...
 
void clear ()
 Reset all sizes to zero. More...
 
void reset (const polyMesh &mesh)
 
void reset (const polyMesh &mesh, const enum contentType output, const bool decompose)
 
void renumberCells (const labelUList &mapping)
 Renumber cell ids to account for subset meshes. More...
 
void renumberPoints (const labelUList &mapping)
 Renumber point ids to account for subset meshes. More...
 
const List< uint8_t > & cellTypes () const
 Values for "types" (XML) and "CELL_TYPES" (legacy) More...
 
const labelListvertLabels () const
 Values for "connectivity" (XML) or "CELLS" (legacy) More...
 
const labelListvertOffsets () const
 Values for "offsets" (XML only) More...
 
const labelListfaceLabels () const
 Values for "faces" (XML only) More...
 
const labelListfaceOffsets () const
 Values for "faceoffset" (XML only) More...
 
const labelListaddPointCellLabels () const
 Additional point addressing (from added point to original cell) More...
 
const labelListcellMap () const
 Original cell ids for all cells (regular and decomposed). More...
 
- Public Member Functions inherited from vtuSizing
 vtuSizing () noexcept
 Default construct. More...
 
 vtuSizing (const polyMesh &mesh)
 Construct sizing by analyzing the mesh. More...
 
 vtuSizing (const polyMesh &mesh, const bool decompose)
 Construct sizing by analyzing the mesh. More...
 
void reset (const polyMesh &mesh, const bool decompose=false)
 Reset sizing by analyzing the mesh. More...
 
void clear () noexcept
 Reset all sizes to zero. More...
 
bool decompose () const
 Query the decompose flag (normally off) More...
 
label nCells () const
 Number of cells for the mesh. More...
 
label nPoints () const
 Number of points for the mesh. More...
 
label nVertLabels () const
 Number of vertex labels for the mesh. More...
 
label nFaceLabels () const
 Number of polyhedral face labels for the mesh. More...
 
label nCellsPoly () const
 Number of polyhedral cells for the mesh. More...
 
label nVertPoly () const
 Number of vertex labels for polyhedral cells of the mesh. More...
 
label nAddCells () const
 Number of additional (decomposed) cells for the mesh. More...
 
label nAddPoints () const
 Number of additional (decomposed) points for the mesh. More...
 
label nAddVerts () const
 Number of additional (decomposed) vertices for the mesh. More...
 
label nFieldCells () const
 Number of field cells = nCells + nAddCells. More...
 
label nFieldPoints () const
 Number of field points = nPoints + nAddPoints. More...
 
label sizeOf (const enum contentType output, const enum slotType slot) const
 Return the required size for the storage slot. More...
 
label sizeLegacy () const
 The calculated size for legacy storage. More...
 
label sizeLegacy (const enum slotType slot) const
 The calculated size for legacy storage of the specified slot. More...
 
label sizeXml (const enum slotType slot) const
 The calculated size for xml storage of the specified slot. More...
 
label sizeInternal1 (const enum slotType slot) const
 The calculated size for vtk-internal storage of the specified slot. More...
 
label sizeInternal2 (const enum slotType slot) const
 The calculated size for vtk-internal storage of the specified slot. More...
 
void populateLegacy (const polyMesh &mesh, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
 Populate lists for Legacy output. More...
 
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. More...
 
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
 
void populateInternal (const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< int > &connectivity, UList< int > &offsets, UList< int > &faces, UList< int > &facesOffsets, labelUList &cellMap, labelUList &addPointsIds, const enum contentType output) const
 
void populateInternal (const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< long > &connectivity, UList< long > &offsets, UList< long > &faces, UList< long > &facesOffsets, foamVtkMeshMaps &maps, const enum contentType output) const
 
void populateInternal (const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< long > &connectivity, UList< long > &offsets, UList< long > &faces, UList< long > &facesOffsets, labelUList &cellMap, labelUList &addPointsIds, const enum contentType output) const
 
void populateInternal (const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< long long > &connectivity, UList< long long > &offsets, UList< long long > &faces, UList< long long > &facesOffsets, foamVtkMeshMaps &maps, const enum contentType output) const
 
void populateInternal (const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< long long > &connectivity, UList< long long > &offsets, UList< long long > &faces, UList< long long > &facesOffsets, labelUList &cellMap, labelUList &addPointsIds, const enum contentType output) const
 
void info (Ostream &os) const
 Report some information. More...
 
bool operator== (const vtuSizing &rhs) const
 Test equality. More...
 
bool operator!= (const vtuSizing &rhs) const
 Test inequality. More...
 

Additional Inherited Members

- Public Types inherited from vtuSizing
enum  contentType { LEGACY, XML, INTERNAL1, INTERNAL2 }
 Types of content that the storage may represent. More...
 
enum  slotType { CELLS, CELLS_OFFSETS, FACES, FACES_OFFSETS }
 The possible storage 'slots' that can be used. More...
 
- Static Public Member Functions inherited from vtuSizing
static labelList copyVertLabelsLegacy (const labelUList &connectivity, const label globalPointOffset)
 Copy vertex labels with a global point offset - legacy format. More...
 
static labelList copyVertLabelsXml (const labelUList &connectivity, const label globalPointOffset)
 Copy vertex labels with a global point offset - XML format. More...
 
static labelList copyFaceLabelsXml (const labelUList &faceLabels, const label globalPointOffset)
 Copy faces stream labels with a global point offset - XML format. More...
 
static labelList copyFaceOffsetsXml (const labelUList &faceOffsets, const label prevOffset)
 Copy face offsets with an offset from previous - XML format. More...
 
static void renumberVertLabelsLegacy (labelUList &connectivity, const label globalPointOffset)
 Renumber vertex labels by global point offset - legacy format. More...
 
static void renumberVertLabelsXml (labelUList &connectivity, const label globalPointOffset)
 Renumber vertex labels by global point offset - XML format. More...
 
static void renumberFaceLabelsXml (labelUList &faceLabels, const label globalPointOffset)
 Renumber faces stream labels by global point offset - XML format. More...
 
static void renumberFaceOffsetsXml (labelUList &faceOffsets, const label prevOffset)
 Renumber face offsets with an offset from previous - XML format. More...
 

Detailed Description

A deep-copy description of an OpenFOAM volume mesh in data structures suitable for VTK UnstructuredGrid, including the possibility of decomposing polyhedral cells into primitive cell types.

Knowledge of the vtkUnstructuredGrid and the corresponding .vtu xml file-format aids in understanding this class. The class can be used for the VTK xml format, legacy format, as well as a VTK internal representation. The internal representation is somewhat related to the xml format, but not entirely.

See also
Foam::vtk::vtuSizing
Source files

Definition at line 73 of file foamVtuCells.H.

Constructor & Destructor Documentation

◆ vtuCells() [1/4]

vtuCells ( const enum contentType  output = contentType::XML,
const bool  decompose = false 
)
explicit

Default construct (XML format, no polyhedral decomposition)

◆ vtuCells() [2/4]

vtuCells ( const polyMesh mesh,
const enum contentType  output = contentType::XML,
const bool  decompose = false 
)
explicit

Construct from components, create output information immediately.

◆ vtuCells() [3/4]

vtuCells ( const vtk::outputOptions  opts,
const bool  decompose = false 
)
explicit

Construct from components.

Optionally with polyhedral decomposition.

Definition at line 66 of file foamVtuCells.C.

◆ vtuCells() [4/4]

vtuCells ( const polyMesh mesh,
const vtk::outputOptions  opts,
const bool  decompose = false 
)

Construct from components, create output information immediately.

Definition at line 80 of file foamVtuCells.C.

References mesh.

Member Function Documentation

◆ content()

enum Foam::vtk::vtuCells::contentType content ( ) const
inline

The output content type.

Definition at line 33 of file foamVtuCellsI.H.

◆ decomposeRequested()

bool decomposeRequested ( ) const
inline

Query the polyhedral decompose requested flag.

Definition at line 39 of file foamVtuCellsI.H.

◆ empty()

bool empty ( ) const
inlinenoexcept

True if no cellTypes are populated.

Definition at line 45 of file foamVtuCellsI.H.

◆ size()

Foam::label size ( ) const
inlinenoexcept

The size of populated cellTypes.

Definition at line 51 of file foamVtuCellsI.H.

◆ clear()

void clear ( )

Reset all sizes to zero.

Definition at line 94 of file foamVtuCells.C.

References clear().

Here is the call graph for this function:

◆ reset() [1/2]

void reset ( const polyMesh mesh)

Create the geometry using the previously requested output and decomposition types.

Definition at line 166 of file foamVtuCells.C.

References mesh.

◆ reset() [2/2]

void reset ( const polyMesh mesh,
const enum contentType  output,
const bool  decompose 
)

Respecify requested output and decomposition type prior to creating the geometry

◆ renumberCells()

void renumberCells ( const labelUList mapping)

Renumber cell ids to account for subset meshes.

Definition at line 187 of file foamVtuCells.C.

◆ renumberPoints()

void renumberPoints ( const labelUList mapping)

Renumber point ids to account for subset meshes.

Definition at line 193 of file foamVtuCells.C.

◆ cellTypes()

const Foam::List< uint8_t > & cellTypes ( ) const
inline

Values for "types" (XML) and "CELL_TYPES" (legacy)

Definition at line 58 of file foamVtuCellsI.H.

◆ vertLabels()

const Foam::labelList & vertLabels ( ) const
inline

Values for "connectivity" (XML) or "CELLS" (legacy)

Definition at line 65 of file foamVtuCellsI.H.

◆ vertOffsets()

const Foam::labelList & vertOffsets ( ) const
inline

Values for "offsets" (XML only)

Definition at line 72 of file foamVtuCellsI.H.

◆ faceLabels()

const Foam::labelList & faceLabels ( ) const
inline

Values for "faces" (XML only)

Definition at line 79 of file foamVtuCellsI.H.

◆ faceOffsets()

const Foam::labelList & faceOffsets ( ) const
inline

Values for "faceoffset" (XML only)

Definition at line 86 of file foamVtuCellsI.H.

◆ addPointCellLabels()

const Foam::labelList & addPointCellLabels ( ) const
inline

Additional point addressing (from added point to original cell)

Definition at line 93 of file foamVtuCellsI.H.

◆ cellMap()

const Foam::labelList & cellMap ( ) const
inline

Original cell ids for all cells (regular and decomposed).

Definition at line 100 of file foamVtuCellsI.H.


The documentation for this class was generated from the following files: