<< "15 Point (1 node, ignored when read)");
- DeclException0(ExcGmshNoCellInformation);
+ DeclException2(
+ ExcGmshNoCellInformation,
+ unsigned int,
+ unsigned int,
+ "While reading a gmsh file, the reader function did not find "
+ "any cells. This sometimes happens if the file only contains a "
+ "surface mesh, but not a volume mesh."
+ "\n\n"
+ "The reader function did find " +
+ std::to_string(arg1) + " lines and " + std::to_string(arg2) +
+ " facets (surface triangles or quadrilaterals).");
protected:
/**
else if (cell_type == 5) // hex
nod_num = 8;
}
- else
+ else // file format version 4.0 and later
{
// ignore tag
int tag;
Point (1 node).
*/
- if (((cell_type == 1) && (dim == 1)) ||
- ((cell_type == 2) && (dim == 2)) ||
- ((cell_type == 3) && (dim == 2)) ||
- ((cell_type == 4) && (dim == 3)) ||
- ((cell_type == 5) && (dim == 3)))
+ if (((cell_type == 1) && (dim == 1)) || // a line in 1d
+ ((cell_type == 2) && (dim == 2)) || // a triangle in 2d
+ ((cell_type == 3) && (dim == 2)) || // a quadrilateral in 2d
+ ((cell_type == 4) && (dim == 3)) || // a tet in 3d
+ ((cell_type == 5) && (dim == 3))) // a hex in 3d
// found a cell
{
unsigned int vertices_per_cell = 0;
vertex_indices[cells.back().vertices[i]];
}
}
- else if ((cell_type == 1) && ((dim == 2) || (dim == 3)))
+ else if ((cell_type == 1) &&
+ ((dim == 2) || (dim == 3))) // a line in 2d or 3d
// boundary info
{
subcelldata.boundary_lines.emplace_back();
vertex = numbers::invalid_unsigned_int;
}
}
- else if ((cell_type == 2 || cell_type == 3) && (dim == 3))
+ else if ((cell_type == 2 || cell_type == 3) &&
+ (dim == 3)) // a triangle or a quad in 3d
// boundary info
{
unsigned int vertices_per_cell = 0;
}
AssertDimension(global_cell, n_cells);
}
- // Assert we reached the end of the block
+ // Assert that we reached the end of the block
in >> line;
static const std::string end_elements_marker[] = {"$ENDELM", "$EndElements"};
AssertThrow(line == end_elements_marker[gmsh_file_format == 10 ? 0 : 1],
AssertThrow(in, ExcIO());
// check that we actually read some cells.
- AssertThrow(cells.size() > 0, ExcGmshNoCellInformation());
+ AssertThrow(cells.size() > 0,
+ ExcGmshNoCellInformation(subcelldata.boundary_lines.size(),
+ subcelldata.boundary_quads.size()));
// TODO: the functions below (GridTools::delete_unused_vertices(),
// GridTools::invert_all_negative_measure_cells(),