From 58246c436804c40245d44e85eb51b819c0c50b53 Mon Sep 17 00:00:00 2001 From: peterrum Date: Wed, 14 Aug 2019 04:20:17 +0200 Subject: [PATCH] Modify the definition of CellId Conflicts: include/deal.II/grid/tria.h --- doc/news/changes/minor/20190813PeterMunch | 4 ++++ include/deal.II/grid/tria.h | 2 +- source/grid/cell_id.cc | 5 ++--- source/grid/tria_accessor.cc | 4 +++- 4 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 doc/news/changes/minor/20190813PeterMunch diff --git a/doc/news/changes/minor/20190813PeterMunch b/doc/news/changes/minor/20190813PeterMunch new file mode 100644 index 0000000000..85229cdd54 --- /dev/null +++ b/doc/news/changes/minor/20190813PeterMunch @@ -0,0 +1,4 @@ +New: The definition of CellID has been modified so that it depends on the +unique coarse-cell id and no longer on the coarse-cell index. +
+(Peter Munch, 2019/08/13) diff --git a/include/deal.II/grid/tria.h b/include/deal.II/grid/tria.h index 65826ba89a..0c140e52ce 100644 --- a/include/deal.II/grid/tria.h +++ b/include/deal.II/grid/tria.h @@ -3502,7 +3502,7 @@ public: * Translate the index of coarse cell to its unique id. * * @note: See the note of the method - * translate_coarse_cell_id_to_coarse_cell_index(). + * coarse_cell_id_to_coarse_cell_index(). * * @param coarse_cell_index Index of the coarse cell. * @return Id of the coarse cell. diff --git a/source/grid/cell_id.cc b/source/grid/cell_id.cc index ff5c3d5548..28c4b8206c 100644 --- a/source/grid/cell_id.cc +++ b/source/grid/cell_id.cc @@ -158,9 +158,8 @@ template typename Triangulation::cell_iterator CellId::to_cell(const Triangulation &tria) const { - typename Triangulation::cell_iterator cell(&tria, - 0, - coarse_cell_id); + typename Triangulation::cell_iterator cell( + &tria, 0, tria.coarse_cell_id_to_coarse_cell_index(coarse_cell_id)); for (unsigned int i = 0; i < n_child_indices; ++i) cell = cell->child(static_cast(child_indices[i])); diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 80579e6e84..290917877c 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -2179,7 +2179,9 @@ CellAccessor::id() const Assert(ptr.level() == 0, ExcInternalError()); const unsigned int coarse_index = ptr.index(); - return {coarse_index, n_child_indices, id.data()}; + return {this->tria->coarse_cell_index_to_coarse_cell_id(coarse_index), + n_child_indices, + id.data()}; } -- 2.39.5