// Now see if we know about this type of data set,
// if not, just ignore everything till the next SCALARS
// keyword
- std::string set = "";
- in >> keyword;
- for (const auto &set_cmp : data_sets)
- if (keyword == set_cmp)
- {
- set = keyword;
- break;
- }
- if (set.empty())
+ std::string field_name;
+ in >> field_name;
+ if (std::find(data_sets.begin(),
+ data_sets.end(),
+ field_name) == data_sets.end())
+ // The data set here is not one of the ones we know, so
// keep ignoring everything until the next SCALARS
- // keyword
+ // keyword.
continue;
// Now we got somewhere. Proceed from here.
AssertThrow(
keyword == "LOOKUP_TABLE",
ExcMessage(
- "While reading VTK file, missing keyword LOOKUP_TABLE"));
+ "While reading VTK file, missing keyword 'LOOKUP_TABLE'."));
in >> keyword;
AssertThrow(
keyword == "default",
ExcMessage(
- "While reading VTK file, missing keyword default"));
+ "While reading VTK file, missing keyword 'default'."));
// read material or manifold ids first for all cells,
// then for all faces, and finally for all lines. the
{
double id;
in >> id;
- if (set == "MaterialID")
+ if (field_name == "MaterialID")
cells[i].material_id =
static_cast<types::material_id>(id);
- else if (set == "ManifoldID")
+ else if (field_name == "ManifoldID")
cells[i].manifold_id =
static_cast<types::manifold_id>(id);
else
{
double id;
in >> id;
- if (set == "MaterialID")
+ if (field_name == "MaterialID")
boundary_quad.material_id =
static_cast<types::material_id>(id);
- else if (set == "ManifoldID")
+ else if (field_name == "ManifoldID")
boundary_quad.manifold_id =
static_cast<types::manifold_id>(id);
else
{
double id;
in >> id;
- if (set == "MaterialID")
+ if (field_name == "MaterialID")
boundary_line.material_id =
static_cast<types::material_id>(id);
- else if (set == "ManifoldID")
+ else if (field_name == "ManifoldID")
boundary_line.manifold_id =
static_cast<types::manifold_id>(id);
else
{
double id;
in >> id;
- if (set == "MaterialID")
+ if (field_name == "MaterialID")
boundary_line.material_id =
static_cast<types::material_id>(id);
- else if (set == "ManifoldID")
+ else if (field_name == "ManifoldID")
boundary_line.manifold_id =
static_cast<types::manifold_id>(id);
else