47void
InterGridMap<MeshType>::make_mapping(const MeshType &source_grid,
48 const MeshType &destination_grid)
54 this->source_grid = &source_grid;
55 this->destination_grid = &destination_grid;
59 const unsigned int n_levels = source_grid.get_triangulation().n_levels();
60 mapping.resize(n_levels);
70 unsigned int n_cells = 0;
72 endc = source_grid.end(
level);
73 for (; cell != endc; ++cell)
74 if (
static_cast<unsigned int>(cell->index()) > n_cells)
75 n_cells = cell->index();
80 mapping[
level].resize(n_cells + 1, destination_grid.end());
90 dst_cell = destination_grid.begin(0), endc = source_grid.end(0);
91 for (; src_cell != endc; ++src_cell, ++dst_cell)
92 set_mapping(src_cell, dst_cell);
96 Assert(dst_cell == destination_grid.end(0), ExcIncompatibleGrids());
107 mapping[src_cell->level()][src_cell->index()] = dst_cell;
111 if (src_cell->has_children() && dst_cell->has_children())
113 Assert(src_cell->n_children() ==
116 Assert(dst_cell->n_children() ==
119 Assert(src_cell->refinement_case() == dst_cell->refinement_case(),
121 for (
unsigned int c = 0;
122 c < GeometryInfo<MeshType::dimension>::max_children_per_cell;
124 set_mapping(src_cell->child(c), dst_cell->child(c));
126 else if (src_cell->has_children() && !dst_cell->has_children())
131 for (
unsigned int c = 0; c < src_cell->n_children(); ++c)
132 set_entries_to_cell(src_cell->child(c), dst_cell);
146 mapping[src_cell->level()][src_cell->index()] = dst_cell;
150 if (src_cell->has_children())
151 for (
unsigned int c = 0; c < src_cell->n_children(); ++c)
152 set_entries_to_cell(src_cell->child(c), dst_cell);