Go to the documentation of this file.
38 void Foam::vtk::vtuSizing::presizeMaps(foamVtkMeshMaps& maps)
const
41 maps.additionalIds().setSize(this->
nAddPoints());
60 reset(
mesh, decompose);
101 decompose_ = decompose;
102 nCells_ =
mesh.nCells();
103 nPoints_ =
mesh.nPoints();
107 nCellsPoly_ = nCells_;
114 for (
label celli=0; celli < len; ++celli)
129 nVertLabels_ += shape.size();
131 else if (model == tetWedge && decompose)
135 else if (model == wedge && decompose)
147 const cell& cFaces =
mesh.cells()[celli];
148 for (
const label facei : cFaces)
154 label nTria = 0, nQuad = 0;
155 f.nTrianglesQuads(
mesh.points(), nTria, nQuad);
157 nAddCells_ += nTria + nQuad;
158 nAddVerts_ += (nTria * 4) + (nQuad * 5);
165 const label nvrt = (nQuad ? 5 : 4);
167 nVertLabels_ += nvrt;
184 for (
const label facei : cFaces)
187 nFaceLabels_ +=
f.size();
194 nVertLabels_ += hashUniqId.
size();
195 nVertPoly_ += hashUniqId.
size();
197 nFaceLabels_ += 1 + cFaces.size();
202 decompose_ = (decompose && nCellsPoly_);
214 case contentType::LEGACY:
224 nVertLabels() + nAddVerts() - nVertPoly()
235 case contentType::XML:
240 return (nVertLabels() + nAddVerts());
243 case slotType::CELLS_OFFSETS:
244 return nFieldCells();
248 return nFaceLabels();
251 case slotType::FACES_OFFSETS:
252 return nFaceLabels() ? nFieldCells() : 0;
257 case contentType::INTERNAL:
263 return (nVertLabels() + nAddVerts() + nFieldCells());
266 case slotType::CELLS_OFFSETS:
267 return nFieldCells();
271 return nFaceLabels();
274 case slotType::FACES_OFFSETS:
275 return nFaceLabels() ? nFieldCells() : 0;
368 contentType::INTERNAL,
397 contentType::INTERNAL,
426 contentType::INTERNAL,
454 contentType::INTERNAL,
482 contentType::INTERNAL,
510 contentType::INTERNAL,
522 const label globalPointOffset
525 if (!globalPointOffset)
531 renumberVertLabelsLegacy(output, globalPointOffset);
540 const label globalPointOffset
543 if (!globalPointOffset)
561 auto iter = vertLabels.
begin();
562 auto last = vertLabels.
end();
566 label nLabels = *iter;
575 *iter += globalPointOffset;
583 label nFaces = *iter;
593 *iter += globalPointOffset;
605 const label globalPointOffset
608 if (!globalPointOffset)
614 renumberVertLabelsXml(output, globalPointOffset);
623 const label globalPointOffset
626 if (!globalPointOffset)
634 for (
label& vertId : vertLabels)
636 vertId += globalPointOffset;
644 const label globalPointOffset
647 if (!globalPointOffset)
653 renumberFaceLabelsXml(output, globalPointOffset);
662 const label globalPointOffset
665 if (!globalPointOffset)
673 auto iter = faceLabels.
begin();
674 auto last = faceLabels.
end();
678 label nFaces = *iter;
683 label nLabels = *iter;
688 *iter += globalPointOffset;
699 const label prevOffset
708 renumberFaceOffsetsXml(output, prevOffset);
717 const label prevOffset
742 os <<
"nFieldCells:" << nFieldCells();
745 os <<
" (" << nCells_ <<
"+" << nAddCells_ <<
")";
749 os <<
" (poly:" << nCellsPoly_ <<
")";
752 os <<
" nFieldPoints:" << nFieldPoints();
755 os <<
" (" << nPoints_ <<
"+" << nAddPoints_ <<
")";
758 os <<
" nVertLabels:" << (nVertLabels_ + nAddVerts_);
761 os <<
" (" << nVertLabels_ <<
"+" << nAddVerts_ <<
")";
765 os <<
" (poly:" << nVertPoly_ <<
")";
768 os <<
" nFaceLabels:" << nFaceLabels_;
769 os <<
" legacy-count:" << sizeLegacy();
781 && nCells() == rhs.
nCells()
label nCells() const
Number of cells for the mesh.
static void renumberFaceLabelsXml(labelUList &faceLabels, const label globalPointOffset)
Renumber faces stream labels by global point offset - XML format.
label size() const noexcept
The number of elements in table.
label ListType::const_reference val
bool decompose() const
Query the decompose flag (normally off)
label nCellsPoly() const
Number of polyhedral cells for the mesh.
vtuSizing()
Construct null.
void populateLegacy(const polyMesh &mesh, UList< uint8_t > &cellTypes, labelUList &connectivity, foamVtkMeshMaps &maps) const
Populate lists for Legacy output.
const labelList & cellMap() const
Original cell ids for all cells (regular and decomposed).
label nAddVerts() const
Number of additional (decomposed) vertices for the mesh.
void info(Ostream &os) const
Report some information.
void clear()
Reset all sizes to zero.
iterator begin()
Return an iterator to begin traversing the UList.
Mesh consisting of general polyhedral cells.
static labelList copyVertLabelsLegacy(const labelUList &connectivity, const label globalPointOffset)
Copy vertex labels with a global point offset - legacy format.
bool operator!=(const vtuSizing &rhs) const
Test inequality.
label nFieldCells() const
Number of field cells = nCells + nAddCells.
label nVertPoly() const
Number of vertex labels for polyhedral cells of 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.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
tmp< faMatrix< Type > > operator==(const faMatrix< Type > &, const faMatrix< Type > &)
label nFaceLabels() const
Number of polyhedral face labels for the mesh.
static const cellModel & ref(const modelType model)
Look up reference to cellModel by enumeration. Fatal on failure.
static void renumberVertLabelsLegacy(labelUList &connectivity, const label globalPointOffset)
Renumber vertex labels by global point offset - legacy format.
void populateInternal(const polyMesh &mesh, UList< uint8_t > &cellTypes, UList< int > &connectivity, UList< int > &offsets, UList< int > &faces, UList< int > &facesOffsets, foamVtkMeshMaps &maps) const
Populate lists for Internal VTK format.
label nPoints() const
Number of points for the mesh.
An analytical geometric cellShape.
label nVertLabels() const
Number of vertex labels for the mesh.
contentType
Types of content that the storage may represent.
Sizing descriptions and routines for transcribing an OpenFOAM volume mesh into a VTK unstructured gri...
static void renumberFaceOffsetsXml(labelUList &faceOffsets, const label prevOffset)
Renumber face offsets with an offset from previous - XML format.
IOstream & hex(IOstream &io)
static labelList copyVertLabelsXml(const labelUList &connectivity, const label globalPointOffset)
Copy vertex labels with a global point offset - XML format.
const labelList & cellTypes
void clear()
Clear all entries from table.
static labelList copyFaceOffsetsXml(const labelUList &faceOffsets, const label prevOffset)
Copy face offsets with an offset from previous - XML format.
static void renumberVertLabelsXml(labelUList &connectivity, const label globalPointOffset)
Renumber vertex labels by global point offset - XML format.
static labelList copyFaceLabelsXml(const labelUList &faceLabels, const label globalPointOffset)
Copy faces stream labels with a global point offset - XML format.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
bool insert(const Key &key)
Insert a new entry, not overwriting existing entries.
const labelList & additionalIds() const
Any additional (user) labels.
slotType
The possible storage 'slots' that can be used.
label nAddPoints() const
Number of additional (decomposed) points for the mesh.
A face is a list of labels corresponding to mesh vertices.
Maps a geometry to a set of cell primitives.
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
iterator end()
Return an iterator to end traversing the UList.
label nAddCells() const
Number of additional (decomposed) cells for the mesh.
A cell is defined as a list of faces with extra functionality.
bool operator==(const vtuSizing &rhs) const
Test equality.
void reset(const polyMesh &mesh, const bool decompose=false)
Reset sizing by analyzing the mesh.
Bookkeeping for mesh subsetting and/or polyhedral cell decomposition. Although the main use case is f...
label sizeOf(const enum contentType output, const enum slotType slot) const
Return the required size for the storage slot.
const cellModel & model() const
Model reference.