From: Daniel Arndt Date: Sun, 18 Nov 2018 11:38:29 +0000 (+0100) Subject: Move definition of global points inside GridGenerator funtions X-Git-Tag: v9.1.0-rc1~542^2~2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6525ee51f8485de7abf6f77e452830b04d42f842;p=dealii.git Move definition of global points inside GridGenerator funtions --- diff --git a/source/grid/grid_generator.cc b/source/grid/grid_generator.cc index 44e8a50ed0..793c033881 100644 --- a/source/grid/grid_generator.cc +++ b/source/grid/grid_generator.cc @@ -35,26 +35,6 @@ namespace GridGenerator { namespace { - // Corner points of the cube [-1,1]^3 - const Point<3> hexahedron[8] = {Point<3>(-1, -1, -1), - Point<3>(+1, -1, -1), - Point<3>(-1, +1, -1), - Point<3>(+1, +1, -1), - Point<3>(-1, -1, +1), - Point<3>(+1, -1, +1), - Point<3>(-1, +1, +1), - Point<3>(+1, +1, +1)}; - - // Octahedron inscribed in the cube - // [-1,1]^3 - const Point<3> octahedron[6] = {Point<3>(-1, 0, 0), - Point<3>(1, 0, 0), - Point<3>(0, -1, 0), - Point<3>(0, 1, 0), - Point<3>(0, 0, -1), - Point<3>(0, 0, 1)}; - - /** * Perform the action specified by the @p colorize flag of the * hyper_rectangle() function of this class. @@ -3919,6 +3899,16 @@ namespace GridGenerator std::vector> vertices; std::vector> cells; + // Corner points of the cube [-1,1]^3 + static const std::array, 8> hexahedron = {{{-1, -1, -1}, // + {+1, -1, -1}, // + {-1, +1, -1}, // + {+1, +1, -1}, // + {-1, -1, +1}, // + {+1, -1, +1}, // + {-1, +1, +1}, // + {+1, +1, +1}}}; + // Start with the shell bounded by // two nested cubes if (n == 6) @@ -3952,8 +3942,17 @@ namespace GridGenerator // A more regular subdivision can // be obtained by two nested // rhombic dodecahedra + else if (n == 12) { + // Octahedron inscribed in the cube [-1,1]^3 + static const std::array, 6> octahedron = {{{-1, 0, 0}, // + {1, 0, 0}, // + {0, -1, 0}, // + {0, 1, 0}, // + {0, 0, -1}, // + {0, 0, 1}}}; + for (unsigned int i = 0; i < 8; ++i) vertices.push_back(p + hexahedron[i] * irad); for (unsigned int i = 0; i < 6; ++i)