45void
InterGridMap<MeshType>::make_mapping(const MeshType &source_grid,
46 const MeshType &destination_grid)
52 this->source_grid = &source_grid;
53 this->destination_grid = &destination_grid;
57 const unsigned int n_levels = source_grid.get_triangulation().n_levels();
58 mapping.resize(n_levels);
68 unsigned int n_cells = 0;
70 endc = source_grid.end(
level);
71 for (; cell != endc; ++cell)
72 if (
static_cast<unsigned int>(cell->index()) > n_cells)
73 n_cells = cell->index();
78 mapping[
level].resize(n_cells + 1, destination_grid.end());
88 dst_cell = destination_grid.begin(0), endc = source_grid.end(0);
89 for (; src_cell != endc; ++src_cell, ++dst_cell)
90 set_mapping(src_cell, dst_cell);
94 Assert(dst_cell == destination_grid.end(0), ExcIncompatibleGrids());
105 mapping[src_cell->level()][src_cell->index()] = dst_cell;
109 if (src_cell->has_children() && dst_cell->has_children())
111 Assert(src_cell->n_children() ==
114 Assert(dst_cell->n_children() ==
117 Assert(src_cell->refinement_case() == dst_cell->refinement_case(),
119 for (
unsigned int c = 0;
120 c < GeometryInfo<MeshType::dimension>::max_children_per_cell;
122 set_mapping(src_cell->child(c), dst_cell->child(c));
124 else if (src_cell->has_children() && !dst_cell->has_children())
129 for (
unsigned int c = 0; c < src_cell->n_children(); ++c)
130 set_entries_to_cell(src_cell->child(c), dst_cell);
144 mapping[src_cell->level()][src_cell->index()] = dst_cell;
148 if (src_cell->has_children())
149 for (
unsigned int c = 0; c < src_cell->n_children(); ++c)
150 set_entries_to_cell(src_cell->child(c), dst_cell);