]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Vector of boundary indicator is now returned.
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 10 Oct 2005 07:09:47 +0000 (07:09 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Mon, 10 Oct 2005 07:09:47 +0000 (07:09 +0000)
git-svn-id: https://svn.dealii.org/trunk@11581 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/grid/tria.h
deal.II/deal.II/source/grid/tria.cc

index 18cb07e437f4ce5b3f676e87778fd65daa063d4a..e310389848b4ff559b88909f27c9b2f8b9b89ce7 100644 (file)
@@ -1702,21 +1702,19 @@ class Triangulation : public Subscriptor
     const Boundary<dim> & get_boundary (const unsigned int number) const;
 
                                     /**
-                                     * Fill the boundary_indicators
-                                     * vector with all boundary
-                                     * indicators assigned to
-                                     * boundary faces of this
-                                     * Triangulation object. Note,
-                                     * that each boundary indicator
-                                     * is reported only once. The
-                                     * boundary_indicators vector
-                                     * will be resized to match the
-                                     * number of different indicators
-                                     * (which is greater or equal
-                                     * one).
-                                     */
-    void get_boundary_indicators(
-      std::vector<unsigned char> &boundary_indicators) const;
+                                     * Returns a vector containing
+                                     * all boundary indicators
+                                     * assigned to boundary faces of
+                                     * this Triangulation
+                                     * object. Note, that each
+                                     * boundary indicator is reported
+                                     * only once. The size of the
+                                     * return vector will represent
+                                     * the number of different
+                                     * indicators (which is greater
+                                     * or equal one).
+                                     */
+    std::vector<unsigned char> get_boundary_indicators() const;
     
                                     /**
                                      *  Copy a triangulation. This
index 2e6de959cf3dcec0ab732790155d67a7f84e2487..3f9eb96d73ef6de4244f7a808df203fbe08ff6cd 100644 (file)
@@ -124,19 +124,17 @@ Triangulation<dim>::get_boundary (const unsigned int number) const
 #if deal_II_dimension == 1
 
 template <>
-void
-Triangulation<1>::get_boundary_indicators (
-  std::vector<unsigned char> &boundary_indicators) const 
+std::vector<unsigned char>
+Triangulation<1>::get_boundary_indicators () const 
 {
-  boundary_indicators.resize(0);
+  return std::vector<unsigned char> (0);
 }
 
 #else
 
 template <int dim>
-void
-Triangulation<dim>::get_boundary_indicators (
-  std::vector<unsigned char> &boundary_indicators) const 
+std::vector<unsigned char>
+Triangulation<dim>::get_boundary_indicators () const 
 {
   std::vector<bool> bi_exists(255, false);
   active_cell_iterator cell=begin_active();
@@ -148,11 +146,13 @@ Triangulation<dim>::get_boundary_indicators (
   const unsigned int n_bi=
     std::count(bi_exists.begin(), bi_exists.end(), true);
 
-  boundary_indicators.resize(n_bi);
+  std::vector<unsigned char> boundary_indicators(n_bi);
   unsigned int bi_counter=0;
   for (unsigned int i=0; i<bi_exists.size(); ++i)
     if (bi_exists[i]==true)
       boundary_indicators[bi_counter++]=i;
+
+  return boundary_indicators;
 }
 
 #endif

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.