From: Wolfgang Bangerth Date: Fri, 31 Jul 2009 21:24:45 +0000 (+0000) Subject: Provide a shortcut to get at the boundary object of a face/edge. X-Git-Tag: v8.0.0~7413 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=224f4ba4835487b1dc08c114078aa57cd3597be5;p=dealii.git Provide a shortcut to get at the boundary object of a face/edge. git-svn-id: https://svn.dealii.org/trunk@19152 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/include/grid/tria_accessor.h b/deal.II/deal.II/include/grid/tria_accessor.h index 0c09f3af59..47c97d1127 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.h +++ b/deal.II/deal.II/include/grid/tria_accessor.h @@ -36,6 +36,8 @@ template class TriaRawIterator; template class TriaIterator; template class TriaActiveIterator; +template class Boundary; + namespace internal { @@ -1217,6 +1219,18 @@ class TriaAccessor : public TriaAccessorBase */ bool at_boundary () const; + /** + * Return a constant reference to a + * boundary object used for this + * object. This function is a shortcut to + * retrieving the boundary indicator + * using boundary_indicator() and then + * asking the + * Triangulation::get_boundary() function + * for the boundary object. + */ + const Boundary & get_boundary () const; + /** * @} */ 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 0fd98bff7c..f83877e04d 100644 --- a/deal.II/deal.II/include/grid/tria_accessor.templates.h +++ b/deal.II/deal.II/include/grid/tria_accessor.templates.h @@ -1862,6 +1862,19 @@ TriaAccessor::at_boundary () const +template +const Boundary & +TriaAccessor::get_boundary () const +{ + Assert (structdimused(), TriaAccessorExceptions::ExcCellNotUsed()); + + return this->tria->get_boundary(this->objects() + .material_id[this->present_index]); +} + + + template double TriaAccessor::diameter () const diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 2e32cc1c11..6fc71ba726 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -276,6 +276,17 @@ inconvenience this causes.

deal.II

    +
  1. +

    + New: Instead of asking face or edge iterators for their boundary indicator + using TriaAccessor::boundary_indicator() and then the triangulation for + the boundary object using Triangulation::get_boundary(), you can now directly + ask the iterator for the boundary object using TriaAccessor::get_boundary(). +
    + (WB 2009/07/31) +

    +
  2. +
  3. Fixed: The CellAccessor::recursively_set_material_id function did not