ExcMessage("The two meshes must be represent triangulations that "
"have the same coarse meshes"));
- // the algorithm goes as follows:
- // first, we fill a list with pairs
- // of iterators common to the two
- // meshes on the coarsest
- // level. then we traverse the
- // list; each time, we find a pair
- // of iterators for which both
- // correspond to non-active cells,
- // we delete this item and push the
- // pairs of iterators to their
- // children to the back. if these
- // again both correspond to
- // non-active cells, we will get to
- // the later on for further
+ // the algorithm goes as follows: first, we fill a list with pairs of
+ // iterators common to the two meshes on the coarsest level. then we
+ // traverse the list; each time, we find a pair of iterators for which
+ // both correspond to non-active cells, we delete this item and push the
+ // pairs of iterators to their children to the back. if these again both
+ // correspond to non-active cells, we will get to the later on for further
// consideration
using CellList = std::list<std::pair<typename MeshType::cell_iterator,
typename MeshType::cell_iterator>>;
for (; cell_1 != mesh_1.end(0); ++cell_1, ++cell_2)
cell_list.emplace_back(cell_1, cell_2);
- // then traverse list as described
- // above
+ // then traverse list as described above
typename CellList::iterator cell_pair = cell_list.begin();
while (cell_pair != cell_list.end())
{
- // if both cells in this pair
- // have children, then erase
- // this element and push their
- // children instead
+ // if both cells in this pair have children, then erase this element
+ // and push their children instead
if (cell_pair->first->has_children() &&
cell_pair->second->has_children())
{
cell_list.emplace_back(cell_pair->first->child(c),
cell_pair->second->child(c));
- // erasing an iterator
- // keeps other iterators
- // valid, so already
- // advance the present
- // iterator by one and then
- // delete the element we've
- // visited before
+ // erasing an iterator keeps other iterators valid, so already
+ // advance the present iterator by one and then delete the element
+ // we've visited before
const typename CellList::iterator previous_cell_pair = cell_pair;
++cell_pair;
cell_list.erase(previous_cell_pair);
}
else
- // both cells are active, do
- // nothing
+ // both cells are active, do nothing
++cell_pair;
}
- // just to make sure everything is ok,
- // validate that all pairs have at least one
- // active iterator or have different
- // refinement_cases
+ // just to make sure everything is ok, validate that all pairs have at
+ // least one active iterator or have different refinement_cases
for (cell_pair = cell_list.begin(); cell_pair != cell_list.end();
++cell_pair)
Assert(cell_pair->first->active() || cell_pair->second->active() ||