64 os.writeInt(++pointId, 8);
87 const label nTotParcels =
procAddr.totalSize();
90 Pstream::broadcast(noCloud);
92 if (UPstream::master())
94 os.beginParticleCoordinates(nTotParcels);
102 if (UPstream::master())
104 const bool isBinaryOutput = (
os.format() == IOstreamOption::BINARY);
113 for (label
id = 1;
id <= nTotParcels; ++id)
134 for (
const label proci :
procAddr.subProcs())
136 const label procSize =
procAddr.localSize(proci);
144 UPstream::commsTypes::scheduled,
161 else if (UPstream::is_subrank())
163 if (positions.
size())
167 UPstream::commsTypes::scheduled,
168 UPstream::masterNo(),
210 const label nLocalParcels
212 parcelsPtr ? parcelsPtr->size() : 0
223 positions.
reserve(UPstream::master() ?
procAddr.maxSize() : nLocalParcels);
227 const auto& parcels = *parcelsPtr;
229 positions.resize_nocopy(parcels.size());
231 auto iter = positions.begin();
233 if (std::is_same<float, vector::cmptType>::value)
235 for (
const auto&
p : parcels)
237 *iter =
p.position();
243 for (
const auto&
p : parcels)
254 parcelsPtr.
reset(
nullptr);
A variant of OFstream with specialised handling for Ensight writing of strings, integers and floats (...
void size(const label n)
Older name for setAddressableSize.
bool writeCloudPositions(ensightFile &os, DynamicList< floatVector > &positions, const globalIndex &procAddr)
Write cloud positions.
float narrowFloat(const double val)
Type narrowing from double to float.
virtual Ostream & write(const char c) override
Write character.
static void writeMeasured_binary(ensightFile &os, const UList< floatVector > &points)
Binary output.
void reserve_nocopy(const label len)
Reserve allocation space for at least this size, allocating new space if required without retaining o...
Dispatch tag: Construct 'one-sided' from local sizes, using gather but no broadcast.
char * data_bytes() noexcept
Return pointer to the underlying array serving as data storage,.
A collection of functions for writing clouds as ensight file content.
const char * cdata_bytes() const noexcept
Return pointer to the underlying array serving as data storage,.
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?
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)
void clear() noexcept
Clear the addressed list, i.e. set the size to zero.
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.
void resize_nocopy(const label len)
Alter addressable list size, allocating new space if required without necessarily recovering old cont...
Pointer management similar to std::unique_ptr, with some additional methods and type checking...
std::streamsize size_bytes() const noexcept
Number of contiguous bytes for the List data.