}
}
- // the second part is setting the
- // half-sphere on top of this
- {
- // add four cubes to the top of
- // the inner four cells, as well
- // as 8 to their outside
- {
- // mirror the first nine vertices
- // above the surface, and scale
- // them to a certain distance
- // outward
- const double rx = PhantomGeometry::r1 / (1+std::sqrt(3.0));
- for (unsigned int i=0; i<9; ++i)
- {
- Point<3> p (vertices[i][0],
- vertices[i][1],
- i == 0 ?
- 1
- :
- std::max(std::fabs(vertices[i][0]),
- std::fabs(vertices[i][1])));
- vertices.push_back (p / std::sqrt(p.square()) * rx);
- }
- Assert (vertices.size() == 59, ExcInternalError());
-
- // same with the next ring of
- // vertices, except that they
- // go to r1
- for (unsigned int i=9; i<17; ++i)
- {
- Point<3> p (vertices[i][0],
- vertices[i][1],
- std::max(std::fabs(vertices[i][0]),
- std::fabs(vertices[i][1])));
- vertices.push_back (p / std::sqrt(p.square()) *
- PhantomGeometry::r1);
- }
- Assert (vertices.size() == 67, ExcInternalError());
-
- // make 12 cells out of this
- const unsigned int connectivity[12][4]
- = { { 1, 2, 3, 0 }, // four cells in the center
- { 3, 4, 5, 0 },
- { 0, 5, 6, 7 },
- { 1, 0, 7, 8 },
-
- { 9, 10, 2, 1 }, // eight cells of inner ring
- { 10, 11, 3, 2 },
- { 11, 12, 4, 3 },
- { 4, 12, 13, 5 },
- { 5, 13, 14, 6 },
- { 6, 14, 15, 7 },
- { 8, 7, 15, 16 },
- { 9, 1, 8, 16 },
- };
-
- for (unsigned int i=0; i<12; ++i)
- {
- CellData<3> cell;
- for (unsigned int j=0; j<4; ++j)
- {
- cell.vertices[j] = connectivity[i][j]+50;
- cell.vertices[j+4] = connectivity[i][j];
- }
- cell.material_id = 0;
- cells.push_back (cell);
- }
- }
- }
-
-
// finally generate a triangulation
// out of this
GridReordering<3>::reorder_cells (cells);