]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use brace initialization instead of writing Point<2> a lot. 6843/head
authorDavid Wells <wellsd2@rpi.edu>
Mon, 25 Jun 2018 23:50:00 +0000 (19:50 -0400)
committerDavid Wells <wellsd2@rpi.edu>
Mon, 25 Jun 2018 23:50:00 +0000 (19:50 -0400)
examples/step-49/doc/results.dox

index 303b1ef1ff7ed12f4c9eaab5017bb08fa6e1abac..1340bd644977fc229a62e0f5d224dbd808cdf910 100644 (file)
@@ -98,28 +98,28 @@ void create_2d_grid(
 void create_3d_grid(Triangulation<3> &triangulation)
 {
   // Generate first cross section
-  std::vector<Point<2>> vertices_1{Point<2>(-1.5, 0.),
-                                   Point<2>(-0.5, 0.),
-                                   Point<2>(0.5, 0.),
-                                   Point<2>(1.5, 0.),
+  const std::vector<Point<2>> vertices_1{{-1.5, 0.},
+                                         {-0.5, 0.},
+                                         {0.5, 0.},
+                                         {1.5, 0.},
 
-                                   Point<2>(-1.5, 1.5),
-                                   Point<2>(-0.5, 1.5),
-                                   Point<2>(0.5, 1.5),
-                                   Point<2>(1.5, 1.5),
+                                         {-1.5, 1.5},
+                                         {-0.5, 1.5},
+                                         {0.5, 1.5},
+                                         {1.5, 1.5},
 
-                                   Point<2>(-1.5, 3.),
-                                   Point<2>(-0.5, 3.),
-                                   Point<2>(0.5, 3.),
-                                   Point<2>(1.5, 3.),
+                                         {-1.5, 3.},
+                                         {-0.5, 3.},
+                                         {0.5, 3.},
+                                         {1.5, 3.},
 
-                                   Point<2>(-0.5, 3 + 0.5 * sqrt(3)),
-                                   Point<2>(0.5, 3 + 0.5 * sqrt(3)),
+                                         {-0.5, 3 + 0.5 * sqrt(3)},
+                                         {0.5, 3 + 0.5 * sqrt(3)},
 
-                                   Point<2>(-0.75, 3 + 0.75 * sqrt(3)),
-                                   Point<2>(0.75, 3 + 0.75 * sqrt(3))};
+                                         {-0.75, 3 + 0.75 * sqrt(3)},
+                                         {0.75, 3 + 0.75 * sqrt(3)}};
 
-  std::vector<std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>>
+  const std::vector<std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>>
     cell_vertices_1 = {{{0, 1, 4, 5}},
                        {{1, 2, 5, 6}},
                        {{3, 7, 2, 6}},
@@ -143,39 +143,37 @@ void create_3d_grid(Triangulation<3> &triangulation)
                                        triangulation_3d_1);
 
   // Now do the same with the second volume
-  const std::vector<Point<2>> vertices_2 = {
-    Point<2>(-2.5, 0.),
-    Point<2>(-1.5, 0.),
-    Point<2>(-0.5, 0.),
-    Point<2>(0.5, 0.),
-    Point<2>(1.5, 0.),
-    Point<2>(2.5, 0.),
-
-    Point<2>(-2.5, 1.5),
-    Point<2>(-1.5, 1.5),
-    Point<2>(-0.5, 1.5),
-    Point<2>(0.5, 1.5),
-    Point<2>(1.5, 1.5),
-    Point<2>(2.5, 1.5),
-
-    Point<2>(-2.5, 3.),
-    Point<2>(-1.5, 3.),
-    Point<2>(-0.5, 3.),
-    Point<2>(0.5, 3.),
-    Point<2>(1.5, 3.),
-    Point<2>(2.5, 3.),
-
-    Point<2>(-0.5, 3. + 0.5 * sqrt(3)),
-    Point<2>(0.5, 3. + 0.5 * sqrt(3)),
-
-    Point<2>(-0.75, 3. + 0.75 * sqrt(3)),
-    Point<2>(0.75, 3. + 0.75 * sqrt(3)),
-
-    Point<2>(-1.25, 3. + 1.25 * sqrt(3)),
-    Point<2>(1.25, 3. + 1.25 * sqrt(3))};
-
-  const std::vector<
-    std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>>
+  const std::vector<Point<2>> vertices_2{{-2.5, 0.},
+                                         {-1.5, 0.},
+                                         {-0.5, 0.},
+                                         {0.5, 0.},
+                                         {1.5, 0.},
+                                         {2.5, 0.},
+
+                                         {-2.5, 1.5},
+                                         {-1.5, 1.5},
+                                         {-0.5, 1.5},
+                                         {0.5, 1.5},
+                                         {1.5, 1.5},
+                                         {2.5, 1.5},
+
+                                         {-2.5, 3.},
+                                         {-1.5, 3.},
+                                         {-0.5, 3.},
+                                         {0.5, 3.},
+                                         {1.5, 3.},
+                                         {2.5, 3.},
+
+                                         {-0.5, 3. + 0.5 * sqrt(3)},
+                                         {0.5, 3. + 0.5 * sqrt(3)},
+
+                                         {-0.75, 3. + 0.75 * sqrt(3)},
+                                         {0.75, 3. + 0.75 * sqrt(3)},
+
+                                         {-1.25, 3. + 1.25 * sqrt(3)},
+                                         {1.25, 3. + 1.25 * sqrt(3)}};
+
+  const std::vector<std::array<unsigned int, GeometryInfo<2>::vertices_per_cell>>
     cell_vertices_2 = {{{0, 1, 6, 7}},
                        {{1, 2, 7, 8}},
                        {{2, 3, 8, 9}},

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.