From 2a1d9df4776fc0c8d244270cccebbcdda5a2b5d8 Mon Sep 17 00:00:00 2001 From: wolf Date: Tue, 29 Jun 1999 06:51:38 +0000 Subject: [PATCH] Add a way to get the number of existing vertices, used or not. git-svn-id: https://svn.dealii.org/trunk@1496 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/grid/tria.h | 13 +++++++++++++ deal.II/deal.II/source/grid/tria.cc | 9 +++++++++ 2 files changed, 22 insertions(+) diff --git a/deal.II/deal.II/include/grid/tria.h b/deal.II/deal.II/include/grid/tria.h index 443edb5903..22be019c59 100644 --- a/deal.II/deal.II/include/grid/tria.h +++ b/deal.II/deal.II/include/grid/tria.h @@ -2727,6 +2727,19 @@ class Triangulation */ unsigned int n_levels () const; + /** + * Return the total number of vertices. + * Some of them may not be used, which + * usually happens upon coarsening of + * a triangulation when some vertices are + * discarded, but we do not want to + * renumber the remaining one, leading to + * holes in the numbers of used vertices. + * You can get the number of used vertices + * using #n_used_vertices# function. + */ + unsigned int n_vertices () const; + /** * Return the number of vertices that are * presently in use, i.e. belong to at least diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index eb26357849..8fa9399927 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -3376,6 +3376,15 @@ unsigned int Triangulation::n_levels () const { +template +unsigned int +Triangulation::n_vertices () const +{ + return vertices.size(); +}; + + + template unsigned int Triangulation::n_used_vertices () const -- 2.39.5