]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Provide a shortcut to get at the boundary object of a face/edge.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 31 Jul 2009 21:24:45 +0000 (21:24 +0000)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Fri, 31 Jul 2009 21:24:45 +0000 (21:24 +0000)
git-svn-id: https://svn.dealii.org/trunk@19152 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria_accessor.h
deal.II/deal.II/include/grid/tria_accessor.templates.h
deal.II/doc/news/changes.h

index 0c09f3af595efe84d9a45862210f515cd083c3d2..47c97d1127b4502ef55b5673b36cfc8a2ee9196c 100644 (file)
@@ -36,6 +36,8 @@ template <typename Accessor> class TriaRawIterator;
 template <typename Accessor> class TriaIterator;
 template <typename Accessor> class TriaActiveIterator;
 
+template <int dim, int spacedim> class Boundary;
+
 
 namespace internal
 {
@@ -1217,6 +1219,18 @@ class TriaAccessor : public TriaAccessorBase<structdim, dim, spacedim>
                                      */
     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<dim,spacedim> & get_boundary () const;
+    
                                     /**
                                      * @}
                                      */
index 0fd98bff7c98dc9e576ff13040c87af5f53d1cd8..f83877e04dd712d536d4a2421fddda3392aeac74 100644 (file)
@@ -1862,6 +1862,19 @@ TriaAccessor<structdim, dim, spacedim>::at_boundary () const
 
 
 
+template <int structdim, int dim, int spacedim>
+const Boundary<dim,spacedim> &
+TriaAccessor<structdim, dim, spacedim>::get_boundary () const
+{
+  Assert (structdim<dim, ExcImpossibleInDim(dim));
+  Assert (this->used(), TriaAccessorExceptions::ExcCellNotUsed());
+
+  return this->tria->get_boundary(this->objects()
+                                 .material_id[this->present_index]);
+}
+
+
+
 template <int structdim, int dim, int spacedim>
 double
 TriaAccessor<structdim, dim, spacedim>::diameter () const
index 2e32cc1c11fc142c48d30e8703e91eafd90421c1..6fc71ba726053c889ecf0530b83f63d2f609157d 100644 (file)
@@ -276,6 +276,17 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+  <li>
+  <p>
+  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().
+  <br>
+  (WB 2009/07/31)
+  </p>
+  </li>
+
   <li>
   <p>
   Fixed: The CellAccessor::recursively_set_material_id function did not

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.