]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use double for istream again 7499/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 4 Dec 2018 00:21:07 +0000 (01:21 +0100)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Tue, 4 Dec 2018 00:21:07 +0000 (01:21 +0100)
source/grid/grid_in.cc

index 46f105e3e44fecaf2ec12c3e8b2b8b03e951f045..2f4afa41681a47c0cc156aa22c4dbfc6273095f9 100644 (file)
@@ -412,12 +412,14 @@ GridIn<dim, spacedim>::read_vtk(std::istream &in)
                       // the order used in the following blocks makes sense
                       for (unsigned int i = 0; i < cells.size(); i++)
                         {
-                          types::manifold_id id;
+                          double id;
                           in >> id;
                           if (set == "MaterialID")
-                            cells[i].material_id = id;
+                            cells[i].material_id =
+                              static_cast<types::material_id>(id);
                           else if (set == "ManifoldID")
-                            cells[i].manifold_id = id;
+                            cells[i].manifold_id =
+                              static_cast<types::manifold_id>(id);
                           else
                             Assert(false, ExcInternalError());
                         }
@@ -428,12 +430,14 @@ GridIn<dim, spacedim>::read_vtk(std::istream &in)
                                i < subcelldata.boundary_quads.size();
                                i++)
                             {
-                              types::manifold_id id;
+                              double id;
                               in >> id;
                               if (set == "MaterialID")
-                                subcelldata.boundary_quads[i].material_id = id;
+                                subcelldata.boundary_quads[i].material_id =
+                                  static_cast<types::material_id>(id);
                               else if (set == "ManifoldID")
-                                subcelldata.boundary_quads[i].manifold_id = id;
+                                subcelldata.boundary_quads[i].manifold_id =
+                                  static_cast<types::manifold_id>(id);
                               else
                                 Assert(false, ExcInternalError());
                             }
@@ -441,12 +445,14 @@ GridIn<dim, spacedim>::read_vtk(std::istream &in)
                                i < subcelldata.boundary_lines.size();
                                i++)
                             {
-                              types::manifold_id id;
+                              double id;
                               in >> id;
                               if (set == "MaterialID")
-                                subcelldata.boundary_lines[i].material_id = id;
+                                subcelldata.boundary_lines[i].material_id =
+                                  static_cast<types::material_id>(id);
                               else if (set == "ManifoldID")
-                                subcelldata.boundary_lines[i].manifold_id = id;
+                                subcelldata.boundary_lines[i].manifold_id =
+                                  static_cast<types::manifold_id>(id);
                               else
                                 Assert(false, ExcInternalError());
                             }
@@ -457,12 +463,14 @@ GridIn<dim, spacedim>::read_vtk(std::istream &in)
                                i < subcelldata.boundary_lines.size();
                                i++)
                             {
-                              types::manifold_id id;
+                              double id;
                               in >> id;
                               if (set == "MaterialID")
-                                subcelldata.boundary_lines[i].material_id = id;
+                                subcelldata.boundary_lines[i].material_id =
+                                  static_cast<types::material_id>(id);
                               else if (set == "ManifoldID")
-                                subcelldata.boundary_lines[i].manifold_id = id;
+                                subcelldata.boundary_lines[i].manifold_id =
+                                  static_cast<types::manifold_id>(id);
                               else
                                 Assert(false, ExcInternalError());
                             }

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.