]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add a way to find out about the number of used vertices in a triangulation.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Jun 1999 15:16:30 +0000 (15:16 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 10 Jun 1999 15:16:30 +0000 (15:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@1395 0785d39b-7218-0410-832d-ea1e28bc413d

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

index ed666954a31d4ed36bf35f8c088f8a88176c3aa0..56d912bc976451032fadf124766857906e5a0b6f 100644 (file)
@@ -2743,6 +2743,13 @@ class Triangulation : public TriaDimensionInfo<dim>, public Subscriptor {
                                      */
     unsigned int n_levels () const;
 
+                                    /**
+                                     * Return the number of vertices that are
+                                     * presently in use, i.e. belong to at least
+                                     * one used element.
+                                     */
+    unsigned int n_used_vertices () const;
+    
                                     /**
                                      * Return the maximum number of cells
                                      * meeting at a common vertex. Since this
index aaf3f7f385ead65242cd603e548027b30dbcdf3d..0b789af5e78928232d6834f3006e56e5cc40d730 100644 (file)
@@ -3366,6 +3366,16 @@ unsigned int Triangulation<dim>::n_levels () const {
 
 
 
+template <int dim>
+unsigned int
+Triangulation<dim>::n_used_vertices () const 
+{
+  return count_if (vertices_used.begin(), vertices_used.end(),
+                  bind2nd (equal_to<bool>(), true));
+};
+
+
+
 #if deal_II_dimension == 1
 
 template <>

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.