28 #include "writeFuns.H" 43 const word& fieldName,
45 const fileName& fileName
48 std::ofstream pStream(fileName.c_str());
51 <<
"# vtk DataFile Version 2.0" << std::endl
61 pStream <<
"DATASET POLYDATA" <<
std::endl;
73 pStream <<
"POINTS " << fp.nPoints() <<
" float" <<
std::endl;
75 DynamicList<floatScalar> ptField(3*fp.nPoints());
84 forAll(fp.localFaces(), facei)
86 nFaceVerts += fp.localFaces()[facei].size() + 1;
88 pStream <<
"POLYGONS " << fp.size() <<
' ' << nFaceVerts
92 DynamicList<label> vertLabels(nFaceVerts);
94 forAll(fp.localFaces(), facei)
96 const face& f = fp.localFaces()[facei];
98 vertLabels.append(f.size());
114 <<
"CELL_DATA " << fp.size() << std::endl
118 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.
Ostream & endl(Ostream &os)
Add newline and flush stream.
static void insert(const point &, DynamicList< floatScalar > &dest)
Append point to given DynamicList.
Write faceSet to vtk polydata file. Only one data which is original faceID.
List< label > labelList
A List of labels.
static void write(std::ostream &, const bool, DynamicList< floatScalar > &)
Write floats ascii or binary.
PrimitivePatch< face, List, const pointField & > primitiveFacePatch
Foam::primitiveFacePatch.
void writePatch(const bool binary, const word &setName, const primitiveFacePatch &fp, const word &fieldName, labelList &fieldValues, const fileName &fileName)