Go to the documentation of this file.
54 if (meshi > meshes_.size() - 1)
57 <<
"Mesh " << meshi <<
" out of range "
58 << (meshes_.size() - 1)
62 auto& bv = bufferViews_.create(
name);
63 bv.byteOffset() = bytes_;
64 bv.byteLength() =
fld.size()*3*
sizeof(float);
66 bytes_ += bv.byteLength();
68 auto& acc = accessors_.create(
name);
69 acc.bufferViewId() = bv.id();
72 auto& obj = objects_.create(
name);
76 bv.byteLength() +=
fld.size()*
sizeof(float);
77 bytes_ +=
fld.size()*
sizeof(float);
88 meshes_[meshi].addColour(acc.id());
96 animations_.create(
name);
97 return animations_.size() - 1;
103 const label animationi,
105 const label outputId,
110 if (animationi > animations_.size() - 1)
113 <<
"Animation " << animationi <<
" out of range "
114 << (animations_.size() - 1)
118 const label nodeId = meshId + 1;
122 if (nodeId > meshes_.size())
125 <<
"Node " << nodeId <<
" out of range " << meshes_.size()
129 animations_[animationi].addTranslation
152 label totalBytes = 0;
153 for (
const auto&
object : objects_.data())
155 for (
const auto&
data :
object.
data())
159 reinterpret_cast<const char*
>(&
data),
163 totalBytes +=
sizeof(float);
171 <<
indent <<
"\"generator\" : \"OpenFOAM - www.openfoam.com\"," <<
nl
200 const label nodeId = meshi + 1;
204 if (meshi != meshes_.size() - 1)
os <<
", ";
220 if (meshi != meshes_.size() - 1)
os <<
",";
229 bufferViews_.write(
os,
"bufferViews");
231 accessors_.write(
os,
"accessors");
233 animations_.write(
os,
"animations");
A class for handling words, derived from Foam::string.
A class for handling file names.
const dimensionedScalar alpha
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
Ostream & endl(Ostream &os)
void addToAnimation(const label animationi, const label inputId, const label outputId, const label meshId, const string &interpolation="LINEAR")
A class for handling character strings derived from std::string.
Ostream & incrIndent(Ostream &os)
@ ARRAY_BUFFER
vertex attributes
Base class for glTF entities.
Generic templated field type.
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;for(const word &name :lagrangianScalarNames){ IOField< scalar > fld(IOobject(name, runTime.timeName(), cloud::prefix, mesh, IOobject::MUST_READ, IOobject::NO_WRITE))
Abstract base class for interpolation.
OBJstream os(runTime.globalPath()/outputName)
virtual bool write(const token &tok)=0
Ostream & decrIndent(Ostream &os)
errorManip< error > abort(error &err)
Ostream & indent(Ostream &os)
Output to file stream, using an OSstream.
virtual std::ostream & stdStream()
#define FatalErrorInFunction
label addColourToMesh(const vectorField &fld, const word &name, const label meshi, const scalarField &alpha=scalarField())
label createAnimation(const word &name)
static fileName concat(const std::string &s1, const std::string &s2, const char delim='/')
word name(const expressions::valueTypeCode typeCode)
An Ostream is an abstract base class for all output systems (streams, files, token lists,...
Database for solution data, solver performance and other reduced data.