47 const auto& pfld =
field.boundaryField()[patchi];
49 if (!isA<emptyFvsPatchVectorField>(pfld))
51 SubList<vector>(flat, pp.size(), pp.offset()) = pfld;
61 Foam::vtk::surfaceFieldWriter::surfaceFieldWriter
76 Foam::vtk::surfaceFieldWriter::surfaceFieldWriter
89 Foam::vtk::surfaceFieldWriter::surfaceFieldWriter
126 "case='" + mesh_.time().globalCaseName()
127 +
"' region='" + mesh_.name()
128 +
"' time='" + mesh_.time().timeName()
129 +
"' index='" +
Foam::name(mesh_.time().timeIndex())
141 const pointField& centres = mesh_.faceCentres();
144 numberOfPoints_ = centres.
size();
171 SubList<point>(centres, mesh_.nInternalFaces())
178 SubList<point>(centres, mesh_.boundaryMesh().range())
197 return enter_CellData(0, 0);
204 return enter_PointData(numberOfPoints_, 0);
221 label nFaces =
field.mesh().nFaces();
225 reduce(nFaces, sumOp<label>());
228 if (nFaces != numberOfPoints_)
231 <<
"Expecting " << numberOfPoints_
232 <<
" faces, but found " << nFaces
236 this->beginDataArray<vector>(
field.name(), nFaces);
240 const SubList<vector>
internal(
field, mesh_.nInternalFaces());
266 this->endDataArray();
const polyBoundaryMesh & boundaryMesh() const
Return boundary mesh.
void size(const label n)
Older name for setAddressableSize.
A class for handling file names.
virtual bool beginPointData(label nFields=0)
Begin PointData output section.
errorManipArg< error, int > exit(error &err, const int errNo=1)
error FatalError
Error stream (stdout output on all processes), with additional 'FOAM FATAL ERROR' header text and sta...
Base class for VTK output writers that handle geometry and fields (eg, vtp, vtu data). These output formats are structured as DECLARED, FIELD_DATA, PIECE followed by any CELL_DATA or POINT_DATA.
#define FatalErrorInFunction
Report an error message using Foam::FatalError.
constexpr char nl
The newline '\n' character (0x0a)
GeometricField< vector, fvsPatchField, surfaceMesh > surfaceVectorField
Ostream & endl(Ostream &os)
Add newline and flush stream.
virtual bool beginFile(std::string title="")
Write file header (non-collective)
bool legacy() const noexcept
Commonly used query.
#define forAll(list, i)
Loop across all elements in list.
Encapsulated combinations of output format options. This is primarily useful when defining the output...
void beginPoints(std::ostream &os, label nPoints)
Emit header for POINTS (with trailing newline).
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
void write(const surfaceVectorField &field)
Write field.
virtual bool writeGeometry()
Write cloud positions.
void writeList(vtk::formatter &fmt, const UList< uint8_t > &values)
Write a list of uint8_t values.
Write surfaces fields (as PointData) in VTP format. Legacy VTK format is intentionally not supported...
word format(conversionProperties.get< word >("format"))
virtual bool beginFile(std::string title="")
Write file header (non-collective)
fileTag
Some common XML tags for vtk files.
Mesh data needed to do the Finite Volume discretisation.
void reduce(const List< UPstream::commsStruct > &comms, T &value, const BinaryOp &bop, const int tag, const label comm)
Reduce inplace (cf. MPI Allreduce) using specified communication schedule.
void writeListParallel(vtk::formatter &fmt, const UList< Type > &values)
Write a list of values.
label nBoundaryFaces() const noexcept
Number of boundary faces (== nFaces - nInternalFaces)
virtual bool beginCellData(label nFields=0)
Begin CellData output section for specified number of fields.
static constexpr const zero Zero
Global zero (0)