From: wolf Date: Mon, 12 Jul 2004 13:54:03 +0000 (+0000) Subject: Remove functions that are only for the general template, which should never be used. X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=def45c80ac39bc9bb98caf8f1de0949f6b90fe21;p=dealii-svn.git Remove functions that are only for the general template, which should never be used. git-svn-id: https://svn.dealii.org/trunk@9500 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria_accessor.templates.h b/deal.II/deal.II/include/grid/tria_accessor.templates.h index 76c1ae4a5e..e6e220f044 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -25,8 +25,6 @@ #include -//TODO[WB]: TriaObjectAccessor should never be used since we have specializations. Can we remove the implementations of functions, or what are they there for? - /*------------------------ Functions: TriaAccessor ---------------------------*/ template @@ -821,288 +819,6 @@ TriaObjectAccessor<3,dim>::operator -- () } -/*------------------------ Functions: TriaObjectAccessor ---------------------------*/ - - -template -inline -bool -TriaObjectAccessor::used () const -{ - Assert (this->state() == IteratorState::valid, - typename TriaAccessor::ExcDereferenceInvalidObject()); - return this->tria->levels[this->present_level]->hexes.used[this->present_index]; -} - - - -template -inline -bool -TriaObjectAccessor::user_flag_set () const -{ - Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); - return this->tria->levels[this->present_level]->hexes.user_flags[this->present_index]; -} - - - -template -inline -void -TriaObjectAccessor::set_user_flag () const -{ - Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); - this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = true; -} - - - -template -inline -void TriaObjectAccessor::clear_user_flag () const -{ - Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); - this->tria->levels[this->present_level]->hexes.user_flags[this->present_index] = false; -} - - - -template -inline -TriaIterator > -TriaObjectAccessor::line (const unsigned int i) const -{ - Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); - Assert (i < GeometryInfo::lines_per_cell, - ExcIndexRange(i,0,GeometryInfo::lines_per_cell)); - - switch(celldim) - { - case 2: - return - TriaIterator > - ( - this->tria, - this->present_level, - line_index (i) - ); - case 3: - if (i<4) - return quad(0)->line(i); - else - if (i<8) - return quad(1)->line(i-4); - else - switch (i) - { - case 8: - return quad(2)->line(3); - case 9: - return quad(2)->line(1); - case 10: - return quad(4)->line(1); - case 11: - return quad(4)->line(3); - } - break; - default: - Assert(false, ExcNotImplemented()); - } - - return TriaIterator >(this->tria, -1, -1, 0); -} - - - -template -inline -TriaIterator > -TriaObjectAccessor::quad (const unsigned int i) const -{ - Assert (this->used(), typename TriaAccessor::ExcCellNotUsed()); - Assert (i < GeometryInfo::quads_per_cell, - ExcIndexRange(i,0,GeometryInfo::quads_per_cell)); - return - TriaIterator > - ( - this->tria, - this->present_level, - quad_index (i) - ); -} - - - -template -inline -unsigned int -TriaObjectAccessor::line_index (const unsigned int i) const -{ - Assert (i < GeometryInfo::lines_per_cell, - ExcIndexRange(i,0,GeometryInfo::lines_per_cell)); - - switch(celldim) - { - case 2: - return this->tria->levels[this->present_level] - ->quads.quads[this->present_index].line(i); - case 3: - if (i<4) - return quad(0)->line_index(i); - else - if (i<8) - return quad(1)->line_index(i-4); - else - switch (i) - { - case 8: - return quad(2)->line_index(3); - case 9: - return quad(2)->line_index(1); - case 10: - return quad(4)->line_index(1); - case 11: - return quad(4)->line_index(3); - }; - break; - default: - Assert(false, ExcNotImplemented()); - } - return 0; -} - - - -template -inline -unsigned int -TriaObjectAccessor::quad_index (const unsigned int i) const -{ - Assert (i < GeometryInfo::quads_per_cell, - ExcIndexRange(i,0,GeometryInfo::quads_per_cell)); - - return this->tria->levels[this->present_level]->hexes.hexes[this->present_index].quad(i); -} - - - -template -inline -TriaIterator > -TriaObjectAccessor::child (const unsigned int i) const -{ - Assert (i < GeometryInfo::children_per_cell, - ExcIndexRange(i,0,GeometryInfo::children_per_cell)); - - TriaIterator > - q (this->tria, this->present_level+1, child_index (i)); - - Assert ((q.state() == IteratorState::past_the_end) || q->used(), - typename TriaAccessor::ExcUnusedCellAsChild()); - - return q; -} - - - -template -inline -int TriaObjectAccessor::child_index (const unsigned int i) const -{ - Assert (i < GeometryInfo::children_per_cell, - ExcIndexRange(i,0,GeometryInfo::children_per_cell)); - return this->tria->levels[this->present_level]->hexes.children[this->present_index]+i; -} - - - -template -bool TriaObjectAccessor::has_children () const -{ - Assert (this->state() == IteratorState::valid, - typename TriaAccessor::ExcDereferenceInvalidObject()); - return (this->tria->levels[this->present_level]->hexes.children[this->present_index] != -1); -} - - - -template -inline -unsigned int -TriaObjectAccessor::max_refinement_depth () const -{ - if (!has_children()) - return 0; - - const unsigned int depths[8] = { child(0)->max_refinement_depth() + 1, - child(1)->max_refinement_depth() + 1, - child(2)->max_refinement_depth() + 1, - child(3)->max_refinement_depth() + 1, - child(4)->max_refinement_depth() + 1, - child(5)->max_refinement_depth() + 1, - child(6)->max_refinement_depth() + 1, - child(7)->max_refinement_depth() + 1 }; - return std::max (std::max (std::max (depths[0], depths[1]), - std::max (depths[2], depths[3])), - std::max (std::max (depths[4], depths[5]), - std::max (depths[6], depths[7]))); -} - - - -template -inline -void -TriaObjectAccessor::operator ++ () -{ - ++this->present_index; - // is index still in the range of - // the vector? - while (this->present_index - >= - static_cast(this->tria->levels[this->present_level]->hexes.hexes.size())) - { - // no -> go one level up - ++this->present_level; - this->present_index = 0; - // highest level reached? - if (this->present_level >= static_cast(this->tria->levels.size())) - { - // return with past the end pointer - this->present_level = this->present_index = -1; - return; - }; - }; -} - - - -template -inline -void -TriaObjectAccessor::operator -- () -{ - --this->present_index; - // is index still in the range of - // the vector? - while (this->present_index < 0) - { - // no -> go one level down - --this->present_level; - // lowest level reached? - if (this->present_level == -1) - { - // return with past the end pointer - this->present_level = this->present_index = -1; - return; - }; - // else - this->present_index = this->tria->levels[this->present_level]->hexes.hexes.size()-1; - }; -} - - /*------------------------ Functions: CellAccessor -----------------------*/