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);
Info<< nl<< "Wrote faMesh in vtk format: "<< writer.output().name()<< nl;}{ vtk::lineWriter writer(aMesh.points(), aMesh.edges(), fileName(aMesh.mesh().time().globalPath()/"finiteArea-edges"));writer.writeGeometry();writer.beginCellData(4);writer.writeProcIDs();{ Field< scalar > fld(faMeshTools::flattenEdgeField(aMesh.magLe(), true))
label addField(const Type &fld, const word &name, const label target=-1)
Returns accessor index.
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.
A traits class, which is primarily used for primitives.
A class for handling words, derived from Foam::string.
@ ARRAY_BUFFER
vertex attributes
auto key(const Type &t) -> typename std::enable_if< std::is_enum< Type >::value, typename std::underlying_type< Type >::type >::type
word name(const expressions::valueTypeCode typeCode)
A word representation of a valueTypeCode. Empty for INVALID.