From: Martin Kronbichler Date: Mon, 1 Nov 2021 18:16:09 +0000 (+0100) Subject: Inline active_cell_index functions X-Git-Tag: v9.4.0-rc1~870^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F12903%2Fhead;p=dealii.git Inline active_cell_index functions --- diff --git a/include/deal.II/grid/tria_accessor.templates.h b/include/deal.II/grid/tria_accessor.templates.h index f19b16feed..b26c6514e9 100644 --- a/include/deal.II/grid/tria_accessor.templates.h +++ b/include/deal.II/grid/tria_accessor.templates.h @@ -3863,6 +3863,42 @@ CellAccessor::is_level_cell() } + +template +inline unsigned int +CellAccessor::active_cell_index() const +{ + Assert(this->is_active(), TriaAccessorExceptions::ExcCellNotActive()); + return this->tria->levels[this->present_level] + ->active_cell_indices[this->present_index]; +} + + + +template +inline types::global_cell_index +CellAccessor::global_active_cell_index() const +{ + Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed()); + Assert(this->is_active(), + ExcMessage( + "global_active_cell_index() can only be called on active cells!")); + + return this->tria->levels[this->present_level] + ->global_active_cell_indices[this->present_index]; +} + + + +template +inline types::global_cell_index +CellAccessor::global_level_cell_index() const +{ + return this->tria->levels[this->present_level] + ->global_level_cell_indices[this->present_index]; +} + + DEAL_II_NAMESPACE_CLOSE #endif diff --git a/source/grid/tria_accessor.cc b/source/grid/tria_accessor.cc index 16e6858d63..fd7dac0727 100644 --- a/source/grid/tria_accessor.cc +++ b/source/grid/tria_accessor.cc @@ -2123,17 +2123,6 @@ CellAccessor::parent_index() const -template -unsigned int -CellAccessor::active_cell_index() const -{ - Assert(this->is_active(), TriaAccessorExceptions::ExcCellNotActive()); - return this->tria->levels[this->present_level] - ->active_cell_indices[this->present_index]; -} - - - template void CellAccessor::set_active_cell_index( @@ -2156,21 +2145,6 @@ CellAccessor::set_global_active_cell_index( -template -inline types::global_cell_index -CellAccessor::global_active_cell_index() const -{ - Assert(this->used(), TriaAccessorExceptions::ExcCellNotUsed()); - Assert(this->is_active(), - ExcMessage( - "global_active_cell_index() can only be called on active cells!")); - - return this->tria->levels[this->present_level] - ->global_active_cell_indices[this->present_index]; -} - - - template void CellAccessor::set_global_level_cell_index( @@ -2182,16 +2156,6 @@ CellAccessor::set_global_level_cell_index( -template -inline types::global_cell_index -CellAccessor::global_level_cell_index() const -{ - return this->tria->levels[this->present_level] - ->global_level_cell_indices[this->present_index]; -} - - - template TriaIterator> CellAccessor::parent() const