35 const bool nearCellValue,
36 const fileName& fName,
42 nearCellValue_(nearCellValue),
44 patchIndices_(patchIDs),
47 const fvMesh& mesh = vMesh_.mesh();
48 const polyBoundaryMesh&
patches = mesh.boundaryMesh();
51 if (patchIndices_.size() == 1)
72 const polyPatch& pp =
patches[patchIndices_[i]];
74 nPoints_ += pp.nPoints();
79 nFaceVerts += pp[facei].size() + 1;
83 os_ <<
"POINTS " << nPoints_ <<
" float" <<
std::endl;
85 DynamicList<floatScalar> ptField(3*nPoints_);
89 const polyPatch& pp =
patches[patchIndices_[i]];
95 os_ <<
"POLYGONS " << nFaces_ <<
' ' << nFaceVerts <<
std::endl;
97 DynamicList<label> vertLabels(nFaceVerts);
103 const polyPatch& pp =
patches[patchIndices_[i]];
107 const face&
f = pp.localFaces()[facei];
109 vertLabels.append(
f.size());
122 const fvMesh& mesh = vMesh_.
mesh();
124 DynamicList<floatScalar> fField(nFaces_);
126 os_ <<
"patchID 1 " << nFaces_ <<
" float" <<
std::endl;
132 const polyPatch& pp = mesh.boundaryMesh()[
patchi];
134 if (!isA<emptyPolyPatch>(pp))
#define forAll(list, i)
Loop across all elements in list.
patchWriter(const vtkMesh &, const bool binary, const bool nearCellValue, const fileName &, const labelList &patchIDs)
Construct from components.
void writePatchIndices()
Write cellIDs.
const fvMesh & mesh() const
Access either mesh or submesh.
const fvPatchList & patches
void insert(const scalar, DynamicList< floatScalar > &)
Append scalar to given DynamicList.
void write(std::ostream &os, const bool binary, List< floatScalar > &fField)
Write floats ascii or binary.
void writeHeader(std::ostream &, const bool isBinary, const std::string &title)
Write header.
List< label > labelList
A List of labels.
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.
word name(const bool)
Return a word representation of a bool.
Field< scalar > scalarField
Specialisation of Field<T> for scalar.
void offset(label &lst, const label o)