38 auto& bv = bufferViews_.create(
name);
39 bv.byteOffset() = bytes_;
40 bv.byteLength() =
fld.size()*nCmpts*
sizeof(float);
45 bytes_ += bv.byteLength();
47 auto& acc = accessors_.create(
name);
48 acc.bufferViewId() = bv.id();
51 auto& obj = objects_.create(
name);
61 const label accessorId =
64 auto& gmesh = meshes_.create(
name);
65 gmesh.accessorId() = accessorId;
67 return meshes_.size() - 1;
79 auto& gmesh = getMesh(meshi);
81 const label accessorId = addField(
fld,
name);
83 gmesh.addField(
name, accessorId);
A traits class, which is primarily used for primitives.
label addFieldToMesh(const Type &fld, const word &name, const label meshId)
Returns accessor index.
label addMesh(const Type &fld, const word &name)
Returns index of last mesh.
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.
A class for handling words, derived from Foam::string.
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))
label addField(const Type &fld, const word &name, const label target=-1)
Returns accessor index.
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type