43 const fvMesh& mesh = vMesh_.mesh();
44 const vtkTopo& topo = vMesh_.topo();
48 os_ <<
"DATASET UNSTRUCTURED_GRID" <<
std::endl;
57 const labelList& addPointCellLabels = topo.addPointCellLabels();
58 const label nTotPoints = mesh.nPoints() + addPointCellLabels.size();
60 os_ <<
"POINTS " << nTotPoints <<
" float" <<
std::endl;
62 DynamicList<floatScalar> ptField(3*nTotPoints);
67 forAll(addPointCellLabels, api)
83 forAll(vtkVertLabels, celli)
85 nFaceVerts += vtkVertLabels[celli].size() + 1;
88 os_ <<
"CELLS " << vtkVertLabels.size() <<
' ' << nFaceVerts <<
std::endl;
90 DynamicList<label> vertLabels(nFaceVerts);
92 forAll(vtkVertLabels, celli)
94 const labelList& vtkVerts = vtkVertLabels[celli];
96 vertLabels.
append(vtkVerts.size());
103 const labelList& vtkCellTypes = topo.cellTypes();
108 DynamicList<label> cellTypes(vtkCellTypes.size());
120 const fvMesh& mesh = vMesh_.mesh();
121 const vtkTopo& topo = vMesh_.topo();
122 const labelList& vtkCellTypes = topo.cellTypes();
123 const labelList& superCells = topo.superCells();
126 os_ <<
"cellID 1 " << vtkCellTypes.
size() <<
" int" <<
std::endl;
132 if (vMesh_.useSubMesh())
134 const labelList& cMap = vMesh_.subsetter().cellMap();
136 forAll(mesh.cells(), celli)
138 cellId[labelI++] = cMap[celli];
140 forAll(superCells, superCelli)
142 label origCelli = cMap[superCells[superCelli]];
144 cellId[labelI++] = origCelli;
149 forAll(mesh.cells(), celli)
153 forAll(superCells, superCelli)
155 label origCelli = superCells[superCelli];
157 cellId[labelI++] = origCelli;
List< labelList > labelListList
A List of labelList.
#define forAll(list, i)
Loop across all elements in list.
intWM_LABEL_SIZE_t label
A label is an int32_t or int64_t as specified by the pre-processor macro WM_LABEL_SIZE.
void size(const label)
Override size to be inconsistent with allocated storage.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void writeCellIDs()
Write cellIDs.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
vectorField pointField
pointField is a vectorField.
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
void append(const T &)
Append an element at the end of the list.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
List< label > labelList
A List of labels.
internalWriter(const vtkMesh &, const bool binary, const fileName &)
Construct from components.