87 label nLocalParcels(0);
93 nLocalParcels = parcelsPtr().size();
99 if (Pstream::master())
101 os.beginParticleCoordinates(nTotParcels);
115 positions.
reserve(Pstream::master() ?
procAddr.maxSize() : nLocalParcels);
122 const auto& parcels = *parcelsPtr;
124 positions.resize_nocopy(parcels.size());
126 auto outIter = positions.begin();
128 if (std::is_same<float, vector::cmptType>::value)
132 *outIter =
p.position();
150 parcelsPtr.
reset(
nullptr);
153 if (Pstream::master())
155 const bool isBinaryOutput = (
os.format() == IOstreamOption::BINARY);
164 for (label
id = 1;
id <= nTotParcels; ++id)
182 for (
const label proci :
procAddr.subProcs())
184 const label procSize =
procAddr.localSize(proci);
188 positions.resize_nocopy(procSize);
191 UPstream::commsTypes::scheduled,
193 positions.data_bytes(),
194 positions.size_bytes()
210 if (positions.size())
214 UPstream::commsTypes::scheduled,
215 UPstream::masterNo(),
216 positions.cdata_bytes(),
217 positions.size_bytes()
Ensight output with specialized write() for strings, integers and floats. Correctly handles binary wr...
virtual Ostream & write(const char c)
Write character.
float narrowFloat(const double val)
Type narrowing from double to float.
static void writeMeasured_binary(ensightFile &os, const UList< floatVector > &points)
Binary output.
Dispatch tag. Construct 'one-sided' from local sizes, using gather but no broadcast.
T returnReduce(const T &value, const BinaryOp &bop, const int tag=UPstream::msgType(), const label comm=UPstream::worldComm)
Perform reduction on a copy, using specified binary operation.
A collection of functions for writing clouds as ensight file content.
void reset(T *p=nullptr) noexcept
Delete managed object and set to new given pointer.
dimensionedScalar pos(const dimensionedScalar &ds)
void write(vtk::formatter &fmt, const Type &val, const label n=1)
Component-wise write of a value (N times)
Calculates a unique integer (label so might not have enough room - 2G max) for processor + local inde...
A 1D vector of objects of type <T> that resizes itself as necessary to accept the new objects...
const word cloudName(propsDict.get< word >("cloud"))
A class for handling words, derived from Foam::string.
bool exists(const fileName &name, const bool checkGzip=true, const bool followLink=true)
Does the name exist (as DIRECTORY or FILE) in the file system?
bool writeCloudPositions(ensightFile &os, const fvMesh &mesh, const word &cloudName, bool exists)
Write cloud positions.
A 1D vector of objects of type <T>, where the size of the vector is known and can be used for subscri...
void reserve(const label len)
Reserve allocation space for at least this size, allocating new space if required and retaining old c...
A Vector of values with scalar precision, where scalar is float/double depending on the compilation f...
OBJstream os(runTime.globalPath()/outputName)
static label writeMeasured_ascii(ensightFile &os, label pointId, const UList< floatVector > &points)
ASCII output. Id + position together.
globalIndex procAddr(aMesh.nFaces())
Mesh data needed to do the Finite Volume discretisation.
A Vector of values with float precision.
Pointer management similar to std::unique_ptr, with some additional methods and type checking...