I'm sure others can pitch in with their experience, but in general it's just a matter of putting the appropriate 'attribute' string on each field. The 'name' string can be set to whatever is appropriate. For example:
root/
liquid_solver : v (MACField)
liquid_solver : levelset (SparseField)
or
root/
gas_solver : v (MACField)
gas_solver : density (SparseField)
When you read an .f3d file from disk, you could then use
Field<float>::Vec scalars = in.readScalarLayers<float>();
BOOST_FOREACH (Field<float>::Ptr i, scalars) {
if (i->attribute == "density") {
m_density = i;
}
// etc...
}
Field<Vec3f>::Vec vectors = in.readVectorLayers<float>();
BOOST_FOREACH (Field<Vec3f>::Ptr i, vectors) {
if (i->attribute == "v") {
m_velocity = i;
}
// etc...
}
Hope that helps.