38 const word& fieldName,
40 const fileName& fileName
43 std::ofstream pStream(fileName.c_str());
46 <<
"# vtk DataFile Version 2.0" << std::endl
56 pStream <<
"DATASET POLYDATA" <<
std::endl;
68 pStream <<
"POINTS " << fp.nPoints() <<
" float" <<
std::endl;
70 DynamicList<floatScalar> ptField(3*fp.nPoints());
79 forAll(fp.localFaces(), facei)
81 nFaceVerts += fp.localFaces()[facei].size() + 1;
83 pStream <<
"POLYGONS " << fp.size() <<
' ' << nFaceVerts
87 DynamicList<label> vertLabels(nFaceVerts);
89 forAll(fp.localFaces(), facei)
91 const face& f = fp.localFaces()[facei];
93 vertLabels.append(f.size());
109 <<
"CELL_DATA " << fp.size() << std::endl
113 pStream << fieldName <<
" 1 " << fp.size() <<
" int" <<
std::endl;
#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 writePatch(const bool binary, const word &setName, const primitiveFacePatch &fp, const word &fieldName, labelList &fieldValues, const fileName &fileName)
Write patch.
Ostream & endl(Ostream &os)
Add newline and flush stream.
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
Write faceSet to vtk polydata file. Only one data which is original faceID.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
List< label > labelList
A List of labels.
PrimitivePatch< List< face >, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.