33const char* Foam::vtk::foamVtkBase64Layer::encoding_ =
"base64";
75 write(
reinterpret_cast<const char*
>(&numbytes),
sizeof(uint64_t));
89 write(
reinterpret_cast<const char*
>(&val),
sizeof(label));
96 write(
reinterpret_cast<const char*
>(&val),
sizeof(
float));
105 if (val >= std::numeric_limits<float>::max())
107 write(std::numeric_limits<float>::max());
109 else if (val <= std::numeric_limits<float>::lowest())
111 write(std::numeric_limits<float>::lowest());
An output filter layer to write base-64 encoded content.
bool close()
End the encoding sequence, padding the final characters with '='.
static std::size_t encodedLength(std::size_t n)
The encoded length has 4 bytes out for every 3 bytes in.
virtual bool write()
Write the output fields.
Sums a given list of (at least two or more) fields and outputs the result into a new field,...
Base-64 encoded output layer - normally only used indirectly by formatters.
virtual bool writeSize(const uint64_t numbytes)
Write leading size for binary output.
virtual void write(const float val)
virtual ~foamVtkBase64Layer()
Destructor. Closes/flushes the underlying layer.
virtual void flush()
End the encoding sequence (padding the final characters with '=')
virtual std::size_t encodedLength(std::size_t n) const
The encoded length for base64 encoded output.
virtual const char * encoding() const
Name for the XML append encoding ("base64").
OBJstream os(runTime.globalPath()/outputName)
gmvFile<< "tracers "<< particles.size()<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().x()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().y()<< " ";}gmvFile<< nl;for(const passiveParticle &p :particles){ gmvFile<< p.position().z()<< " ";}gmvFile<< nl;forAll(lagrangianScalarNames, i){ word name=lagrangianScalarNames[i];IOField< scalar > s(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))