From: Martin Kronbichler <kronbichler@lnm.mw.tum.de>
Date: Mon, 30 Jul 2018 09:52:12 +0000 (+0200)
Subject: Mark some variables as const in the high order VTK output.
X-Git-Tag: v9.1.0-rc1~868^2
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=70e3939264a117ccd2fcabecd23599378006d338;p=dealii.git

Mark some variables as const in the high order VTK output.
---

diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc
index 62dc21eff0..82bde59eb5 100644
--- a/source/base/data_out_base.cc
+++ b/source/base/data_out_base.cc
@@ -799,15 +799,15 @@ namespace
    * https://github.com/Kitware/VTK/blob/265ca48a/Common/DataModel/vtkLagrangeQuadrilateral.cxx#L558
    */
   int
-  vtk_point_index_from_ijk(unsigned i,
-                           unsigned j,
-                           unsigned,
+  vtk_point_index_from_ijk(const unsigned i,
+                           const unsigned j,
+                           const unsigned,
                            const std::array<unsigned, 2> &order)
   {
-    bool ibdy = (i == 0 || i == order[0]);
-    bool jbdy = (j == 0 || j == order[1]);
+    const bool ibdy = (i == 0 || i == order[0]);
+    const bool jbdy = (j == 0 || j == order[1]);
     // How many boundaries do we lie on at once?
-    int nbdy = (ibdy ? 1 : 0) + (jbdy ? 1 : 0);
+    const int nbdy = (ibdy ? 1 : 0) + (jbdy ? 1 : 0);
 
     if (nbdy == 2) // Vertex DOF
       { // ijk is a corner node. Return the proper index (somewhere in [0,3]):
@@ -843,16 +843,16 @@ namespace
    * https://github.com/Kitware/VTK/blob/265ca48a/Common/DataModel/vtkLagrangeHexahedron.cxx#L734
    */
   int
-  vtk_point_index_from_ijk(unsigned                       i,
-                           unsigned                       j,
-                           unsigned                       k,
+  vtk_point_index_from_ijk(const unsigned                 i,
+                           const unsigned                 j,
+                           const unsigned                 k,
                            const std::array<unsigned, 3> &order)
   {
-    bool ibdy = (i == 0 || i == order[0]);
-    bool jbdy = (j == 0 || j == order[1]);
-    bool kbdy = (k == 0 || k == order[2]);
+    const bool ibdy = (i == 0 || i == order[0]);
+    const bool jbdy = (j == 0 || j == order[1]);
+    const bool kbdy = (k == 0 || k == order[2]);
     // How many boundaries do we lie on at once?
-    int nbdy = (ibdy ? 1 : 0) + (jbdy ? 1 : 0) + (kbdy ? 1 : 0);
+    const int nbdy = (ibdy ? 1 : 0) + (jbdy ? 1 : 0) + (kbdy ? 1 : 0);
 
     if (nbdy == 3) // Vertex DOF
       { // ijk is a corner node. Return the proper index (somewhere in [0,7]):
@@ -908,9 +908,9 @@ namespace
   }
 
   int
-  vtk_point_index_from_ijk(unsigned,
-                           unsigned,
-                           unsigned,
+  vtk_point_index_from_ijk(const unsigned,
+                           const unsigned,
+                           const unsigned,
                            const std::array<unsigned, 0> &)
   {
     Assert(false, ExcNotImplemented());
@@ -918,9 +918,9 @@ namespace
   }
 
   int
-  vtk_point_index_from_ijk(unsigned,
-                           unsigned,
-                           unsigned,
+  vtk_point_index_from_ijk(const unsigned,
+                           const unsigned,
+                           const unsigned,
                            const std::array<unsigned, 1> &)
   {
     Assert(false, ExcNotImplemented());
diff --git a/tests/data_out/data_out_base_vtk_03.cc b/tests/data_out/data_out_base_vtk_03.cc
index 98c111f910..b770a91c8c 100644
--- a/tests/data_out/data_out_base_vtk_03.cc
+++ b/tests/data_out/data_out_base_vtk_03.cc
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2006 - 2017 by the deal.II authors
+// Copyright (C) 2018 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -45,9 +45,9 @@ check(std::ostream &log, unsigned cell_order)
 int
 main()
 {
-  std::ofstream logfile("output");
+  initlog();
 
   unsigned cell_order = 4;
-  check<2>(logfile, cell_order);
-  check<3>(logfile, cell_order);
+  check<2>(deallog.get_file_stream(), cell_order);
+  check<3>(deallog.get_file_stream(), cell_order);
 }
diff --git a/tests/data_out/data_out_base_vtk_03.output b/tests/data_out/data_out_base_vtk_03.output
index 0af34c3c16..c7c2c1da0b 100644
--- a/tests/data_out/data_out_base_vtk_03.output
+++ b/tests/data_out/data_out_base_vtk_03.output
@@ -1,34 +1,35 @@
+
 # vtk DataFile Version 3.0
 #This file was generated 
 ASCII
 DATASET UNSTRUCTURED_GRID
 
 POINTS 25 double
-0 0 0
-0.25 0 0
-0.5 0 0
-0.75 0 0
-1 0 0
-0 0.25 0
-0.25 0.25 0
-0.5 0.25 0
-0.75 0.25 0
-1 0.25 0
-0 0.5 0
-0.25 0.5 0
-0.5 0.5 0
-0.75 0.5 0
-1 0.5 0
-0 0.75 0
-0.25 0.75 0
-0.5 0.75 0
-0.75 0.75 0
-1 0.75 0
-0 1 0
-0.25 1 0
-0.5 1 0
-0.75 1 0
-1 1 0
+0.00000 0.00000 0
+0.250000 0.00000 0
+0.500000 0.00000 0
+0.750000 0.00000 0
+1.00000 0.00000 0
+0.00000 0.250000 0
+0.250000 0.250000 0
+0.500000 0.250000 0
+0.750000 0.250000 0
+1.00000 0.250000 0
+0.00000 0.500000 0
+0.250000 0.500000 0
+0.500000 0.500000 0
+0.750000 0.500000 0
+1.00000 0.500000 0
+0.00000 0.750000 0
+0.250000 0.750000 0
+0.500000 0.750000 0
+0.750000 0.750000 0
+1.00000 0.750000 0
+0.00000 1.00000 0
+0.250000 1.00000 0
+0.500000 1.00000 0
+0.750000 1.00000 0
+1.00000 1.00000 0
 
 CELLS 1 26
 25	0	4	24	20	1	2	3	9	14	19	21	22	23	5	10	15	6	7	8	11	12	13	16	17	18
@@ -42,131 +43,131 @@ ASCII
 DATASET UNSTRUCTURED_GRID
 
 POINTS 125 double
-0 0 0
-0.25 0 0
-0.5 0 0
-0.75 0 0
-1 0 0
-0 0.25 0
-0.25 0.25 0
-0.5 0.25 0
-0.75 0.25 0
-1 0.25 0
-0 0.5 0
-0.25 0.5 0
-0.5 0.5 0
-0.75 0.5 0
-1 0.5 0
-0 0.75 0
-0.25 0.75 0
-0.5 0.75 0
-0.75 0.75 0
-1 0.75 0
-0 1 0
-0.25 1 0
-0.5 1 0
-0.75 1 0
-1 1 0
-0 0 0.25
-0.25 0 0.25
-0.5 0 0.25
-0.75 0 0.25
-1 0 0.25
-0 0.25 0.25
-0.25 0.25 0.25
-0.5 0.25 0.25
-0.75 0.25 0.25
-1 0.25 0.25
-0 0.5 0.25
-0.25 0.5 0.25
-0.5 0.5 0.25
-0.75 0.5 0.25
-1 0.5 0.25
-0 0.75 0.25
-0.25 0.75 0.25
-0.5 0.75 0.25
-0.75 0.75 0.25
-1 0.75 0.25
-0 1 0.25
-0.25 1 0.25
-0.5 1 0.25
-0.75 1 0.25
-1 1 0.25
-0 0 0.5
-0.25 0 0.5
-0.5 0 0.5
-0.75 0 0.5
-1 0 0.5
-0 0.25 0.5
-0.25 0.25 0.5
-0.5 0.25 0.5
-0.75 0.25 0.5
-1 0.25 0.5
-0 0.5 0.5
-0.25 0.5 0.5
-0.5 0.5 0.5
-0.75 0.5 0.5
-1 0.5 0.5
-0 0.75 0.5
-0.25 0.75 0.5
-0.5 0.75 0.5
-0.75 0.75 0.5
-1 0.75 0.5
-0 1 0.5
-0.25 1 0.5
-0.5 1 0.5
-0.75 1 0.5
-1 1 0.5
-0 0 0.75
-0.25 0 0.75
-0.5 0 0.75
-0.75 0 0.75
-1 0 0.75
-0 0.25 0.75
-0.25 0.25 0.75
-0.5 0.25 0.75
-0.75 0.25 0.75
-1 0.25 0.75
-0 0.5 0.75
-0.25 0.5 0.75
-0.5 0.5 0.75
-0.75 0.5 0.75
-1 0.5 0.75
-0 0.75 0.75
-0.25 0.75 0.75
-0.5 0.75 0.75
-0.75 0.75 0.75
-1 0.75 0.75
-0 1 0.75
-0.25 1 0.75
-0.5 1 0.75
-0.75 1 0.75
-1 1 0.75
-0 0 1
-0.25 0 1
-0.5 0 1
-0.75 0 1
-1 0 1
-0 0.25 1
-0.25 0.25 1
-0.5 0.25 1
-0.75 0.25 1
-1 0.25 1
-0 0.5 1
-0.25 0.5 1
-0.5 0.5 1
-0.75 0.5 1
-1 0.5 1
-0 0.75 1
-0.25 0.75 1
-0.5 0.75 1
-0.75 0.75 1
-1 0.75 1
-0 1 1
-0.25 1 1
-0.5 1 1
-0.75 1 1
-1 1 1
+0.00000 0.00000 0.00000
+0.250000 0.00000 0.00000
+0.500000 0.00000 0.00000
+0.750000 0.00000 0.00000
+1.00000 0.00000 0.00000
+0.00000 0.250000 0.00000
+0.250000 0.250000 0.00000
+0.500000 0.250000 0.00000
+0.750000 0.250000 0.00000
+1.00000 0.250000 0.00000
+0.00000 0.500000 0.00000
+0.250000 0.500000 0.00000
+0.500000 0.500000 0.00000
+0.750000 0.500000 0.00000
+1.00000 0.500000 0.00000
+0.00000 0.750000 0.00000
+0.250000 0.750000 0.00000
+0.500000 0.750000 0.00000
+0.750000 0.750000 0.00000
+1.00000 0.750000 0.00000
+0.00000 1.00000 0.00000
+0.250000 1.00000 0.00000
+0.500000 1.00000 0.00000
+0.750000 1.00000 0.00000
+1.00000 1.00000 0.00000
+0.00000 0.00000 0.250000
+0.250000 0.00000 0.250000
+0.500000 0.00000 0.250000
+0.750000 0.00000 0.250000
+1.00000 0.00000 0.250000
+0.00000 0.250000 0.250000
+0.250000 0.250000 0.250000
+0.500000 0.250000 0.250000
+0.750000 0.250000 0.250000
+1.00000 0.250000 0.250000
+0.00000 0.500000 0.250000
+0.250000 0.500000 0.250000
+0.500000 0.500000 0.250000
+0.750000 0.500000 0.250000
+1.00000 0.500000 0.250000
+0.00000 0.750000 0.250000
+0.250000 0.750000 0.250000
+0.500000 0.750000 0.250000
+0.750000 0.750000 0.250000
+1.00000 0.750000 0.250000
+0.00000 1.00000 0.250000
+0.250000 1.00000 0.250000
+0.500000 1.00000 0.250000
+0.750000 1.00000 0.250000
+1.00000 1.00000 0.250000
+0.00000 0.00000 0.500000
+0.250000 0.00000 0.500000
+0.500000 0.00000 0.500000
+0.750000 0.00000 0.500000
+1.00000 0.00000 0.500000
+0.00000 0.250000 0.500000
+0.250000 0.250000 0.500000
+0.500000 0.250000 0.500000
+0.750000 0.250000 0.500000
+1.00000 0.250000 0.500000
+0.00000 0.500000 0.500000
+0.250000 0.500000 0.500000
+0.500000 0.500000 0.500000
+0.750000 0.500000 0.500000
+1.00000 0.500000 0.500000
+0.00000 0.750000 0.500000
+0.250000 0.750000 0.500000
+0.500000 0.750000 0.500000
+0.750000 0.750000 0.500000
+1.00000 0.750000 0.500000
+0.00000 1.00000 0.500000
+0.250000 1.00000 0.500000
+0.500000 1.00000 0.500000
+0.750000 1.00000 0.500000
+1.00000 1.00000 0.500000
+0.00000 0.00000 0.750000
+0.250000 0.00000 0.750000
+0.500000 0.00000 0.750000
+0.750000 0.00000 0.750000
+1.00000 0.00000 0.750000
+0.00000 0.250000 0.750000
+0.250000 0.250000 0.750000
+0.500000 0.250000 0.750000
+0.750000 0.250000 0.750000
+1.00000 0.250000 0.750000
+0.00000 0.500000 0.750000
+0.250000 0.500000 0.750000
+0.500000 0.500000 0.750000
+0.750000 0.500000 0.750000
+1.00000 0.500000 0.750000
+0.00000 0.750000 0.750000
+0.250000 0.750000 0.750000
+0.500000 0.750000 0.750000
+0.750000 0.750000 0.750000
+1.00000 0.750000 0.750000
+0.00000 1.00000 0.750000
+0.250000 1.00000 0.750000
+0.500000 1.00000 0.750000
+0.750000 1.00000 0.750000
+1.00000 1.00000 0.750000
+0.00000 0.00000 1.00000
+0.250000 0.00000 1.00000
+0.500000 0.00000 1.00000
+0.750000 0.00000 1.00000
+1.00000 0.00000 1.00000
+0.00000 0.250000 1.00000
+0.250000 0.250000 1.00000
+0.500000 0.250000 1.00000
+0.750000 0.250000 1.00000
+1.00000 0.250000 1.00000
+0.00000 0.500000 1.00000
+0.250000 0.500000 1.00000
+0.500000 0.500000 1.00000
+0.750000 0.500000 1.00000
+1.00000 0.500000 1.00000
+0.00000 0.750000 1.00000
+0.250000 0.750000 1.00000
+0.500000 0.750000 1.00000
+0.750000 0.750000 1.00000
+1.00000 0.750000 1.00000
+0.00000 1.00000 1.00000
+0.250000 1.00000 1.00000
+0.500000 1.00000 1.00000
+0.750000 1.00000 1.00000
+1.00000 1.00000 1.00000
 
 CELLS 1 126
 125	0	4	24	20	100	104	124	120	1	2	3	9	14	19	21	22	23	5	10	15	101	102	103	109	114	119	121	122	123	105	110	115	25	50	75	29	54	79	45	70	95	49	74	99	30	35	40	55	60	65	80	85	90	34	39	44	59	64	69	84	89	94	26	27	28	51	52	53	76	77	78	46	47	48	71	72	73	96	97	98	6	7	8	11	12	13	16	17	18	106	107	108	111	112	113	116	117	118	31	32	33	36	37	38	41	42	43	56	57	58	61	62	63	66	67	68	81	82	83	86	87	88	91	92	93