From: Daniel Arndt Date: Sat, 26 Jan 2019 15:54:16 +0000 (+0100) Subject: Rename variables using snake_case style X-Git-Tag: v9.1.0-rc1~385^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=033699e59ff20c5cdb86e069259eba3e715f5cf4;p=dealii.git Rename variables using snake_case style --- diff --git a/source/grid/grid_in.cc b/source/grid/grid_in.cc index 87fe841d9c..2aac678cad 100644 --- a/source/grid/grid_in.cc +++ b/source/grid/grid_in.cc @@ -1455,69 +1455,68 @@ GridIn::read_msh(std::istream &in) // if the next block is of kind $Entities, parse it if (line == "$Entities") { - unsigned long numPoints, numCurves, numSurfaces, numVolumes, - numPhysicals; - int tag, physicalTag; - double boxMinX, boxMinY, boxMinZ, boxMaxX, boxMaxY, boxMaxZ; - - in >> numPoints >> numCurves >> numSurfaces >> numVolumes; - for (unsigned int i = 0; i < numPoints; ++i) + unsigned long n_points, n_curves, n_surfaces, n_volumes, n_physicals; + int tag, physical_tag; + double box_min_x, box_min_y, box_min_z, box_max_x, box_max_y, + box_max_z; + + // we only care for physical_tag to fill tag_maps + in >> n_points >> n_curves >> n_surfaces >> n_volumes; + for (unsigned int i = 0; i < n_points; ++i) { // parse point ids - in >> tag >> boxMinX >> boxMinY >> boxMinZ >> boxMaxX >> - boxMaxY >> boxMaxZ >> numPhysicals; - AssertThrow(numPhysicals < 2, + in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >> + box_max_y >> box_max_z >> n_physicals; + AssertThrow(n_physicals < 2, ExcMessage("More than one tag is not supported!")); - for (unsigned int j = 0; j < numPhysicals; ++j) - in >> physicalTag; - tag_maps[0][tag] = (numPhysicals == 0) ? 0 : physicalTag; + for (unsigned int j = 0; j < n_physicals; ++j) + in >> physical_tag; + tag_maps[0][tag] = (n_physicals == 0) ? 0 : physical_tag; } - for (unsigned int i = 0; i < numCurves; ++i) + for (unsigned int i = 0; i < n_curves; ++i) { // parse curve ids - in >> tag >> boxMinX >> boxMinY >> boxMinZ >> boxMaxX >> - boxMaxY >> boxMaxZ >> numPhysicals; - AssertThrow(numPhysicals < 2, + in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >> + box_max_y >> box_max_z >> n_physicals; + AssertThrow(n_physicals < 2, ExcMessage("More than one tag is not supported!")); - for (unsigned int j = 0; j < numPhysicals; ++j) - in >> physicalTag; - tag_maps[1][tag] = (numPhysicals == 0) ? 0 : physicalTag; - in >> numPoints; - for (unsigned int j = 0; j < numPoints; ++j) + for (unsigned int j = 0; j < n_physicals; ++j) + in >> physical_tag; + tag_maps[1][tag] = (n_physicals == 0) ? 0 : physical_tag; + in >> n_points; + for (unsigned int j = 0; j < n_points; ++j) in >> tag; } - for (unsigned int i = 0; i < numSurfaces; ++i) + for (unsigned int i = 0; i < n_surfaces; ++i) { // parse surface ids - in >> tag >> boxMinX >> boxMinY >> boxMinZ >> boxMaxX >> - boxMaxY >> boxMaxZ >> numPhysicals; - AssertThrow(numPhysicals < 2, + in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >> + box_max_y >> box_max_z >> n_physicals; + AssertThrow(n_physicals < 2, ExcMessage("More than one tag is not supported!")); - for (unsigned int j = 0; j < numPhysicals; ++j) - in >> physicalTag; - tag_maps[2][tag] = (numPhysicals == 0) ? 0 : physicalTag; - in >> numCurves; - for (unsigned int j = 0; j < numCurves; ++j) + for (unsigned int j = 0; j < n_physicals; ++j) + in >> physical_tag; + tag_maps[2][tag] = (n_physicals == 0) ? 0 : physical_tag; + in >> n_curves; + for (unsigned int j = 0; j < n_curves; ++j) in >> tag; } - for (unsigned int i = 0; i < numVolumes; ++i) + for (unsigned int i = 0; i < n_volumes; ++i) { // parse volume ids - in >> tag >> boxMinX >> boxMinY >> boxMinZ >> boxMaxX >> - boxMaxY >> boxMaxZ >> numPhysicals; - AssertThrow(numPhysicals < 2, + in >> tag >> box_min_x >> box_min_y >> box_min_z >> box_max_x >> + box_max_y >> box_max_z >> n_physicals; + AssertThrow(n_physicals < 2, ExcMessage("More than one tag is not supported!")); - for (unsigned int j = 0; j < numPhysicals; ++j) - in >> physicalTag; - tag_maps[3][tag] = (numPhysicals == 0) ? 0 : physicalTag; - in >> numSurfaces; - for (unsigned int j = 0; j < numSurfaces; ++j) + for (unsigned int j = 0; j < n_physicals; ++j) + in >> physical_tag; + tag_maps[3][tag] = (n_physicals == 0) ? 0 : physical_tag; + in >> n_surfaces; + for (unsigned int j = 0; j < n_surfaces; ++j) in >> tag; } - std::cout << line << std::endl; in >> line; - std::cout << line << std::endl; AssertThrow(line == "$EndEntities", ExcInvalidGMSHInput(line)); in >> line; }