Go to the documentation of this file.
86 label nLocalParcels(0);
92 nLocalParcels = parcelsPtr().size();
96 const label nTotParcels =
returnReduce(nLocalParcels, sumOp<label>());
98 if (Pstream::master())
101 os.beginParticleCoordinates(nTotParcels);
111 const globalIndex procAddr
113 UPstream::listGatherValues<label>(nLocalParcels),
118 DynamicList<point> positions;
119 positions.reserve(Pstream::master() ? procAddr.maxSize() : nLocalParcels);
124 const auto& parcels = *parcelsPtr;
126 positions.resize_nocopy(parcels.size());
128 auto outIter = positions.begin();
130 for (
const passiveParticle&
p : parcels)
132 *outIter =
p.position();
136 parcelsPtr.
reset(
nullptr);
139 if (Pstream::master())
142 const bool isBinaryOutput = (
os.format() == IOstream::BINARY);
151 for (label
id = 1;
id <= nTotParcels; ++id)
169 for (
const label proci : procAddr.subProcs())
171 positions.resize_nocopy(procAddr.localSize(proci));
174 UPstream::commsTypes::scheduled,
176 positions.data_bytes(),
177 positions.size_bytes()
195 UPstream::commsTypes::scheduled,
197 positions.cdata_bytes(),
198 positions.size_bytes()
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
static Ostream & output(Ostream &os, const IntRange< T > &range)
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
T returnReduce(const T &Value, const BinaryOp &bop, const int tag=Pstream::msgType(), const label comm=UPstream::worldComm)
void reserve(const label len)
virtual Ostream & write(const char c)
OBJstream os(runTime.globalPath()/outputName)
Mesh data needed to do the Finite Volume discretisation.
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
bool writeCloudPositions(const fvMesh &mesh, const word &cloudName, bool exists, autoPtr< ensightFile > &output)
labelRange subProcs() const noexcept
void reset(autoPtr< T > &&other) noexcept
Pointer management similar to std::unique_ptr, with some additional methods and type checking.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
A collection of functions for writing clouds as ensight file content.
void write(vtk::formatter &fmt, const Type &val, const label n=1)
static void writeMeasured_binary(ensightFile &os, const UList< point > &points)
void resize_nocopy(const label len)
static label writeMeasured_ascii(ensightFile &os, label pointId, const UList< point > &points)
vector point
Point is a vector.