From: Wolfgang Bangerth Date: Mon, 23 Nov 2009 04:45:01 +0000 (+0000) Subject: In n_active_cells(), use the cached values. X-Git-Tag: v8.0.0~6790 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=be8f0ccdf2c30392dd39e67c97901de56aec27d9;p=dealii.git In n_active_cells(), use the cached values. git-svn-id: https://svn.dealii.org/trunk@20150 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/grid/tria.cc b/deal.II/deal.II/source/grid/tria.cc index 5380ba9dc0..d2dc8a9ffb 100644 --- a/deal.II/deal.II/source/grid/tria.cc +++ b/deal.II/deal.II/source/grid/tria.cc @@ -11452,23 +11452,67 @@ Triangulation::last_active_hex () const // -------------------------------- number of cells etc --------------- + +namespace internal +{ + namespace Triangulation + { + unsigned int + n_cells (const internal::Triangulation::NumberCache<1> &c) + { + return c.n_lines; + } + + + unsigned int + n_active_cells (const internal::Triangulation::NumberCache<1> &c) + { + return c.n_active_lines; + } + + + unsigned int + n_cells (const internal::Triangulation::NumberCache<2> &c) + { + return c.n_quads; + } + + + unsigned int + n_active_cells (const internal::Triangulation::NumberCache<2> &c) + { + return c.n_active_quads; + } + + + unsigned int + n_cells (const internal::Triangulation::NumberCache<3> &c) + { + return c.n_hexes; + } + + + unsigned int + n_active_cells (const internal::Triangulation::NumberCache<3> &c) + { + return c.n_active_hexes; + } + } +} + + + template unsigned int Triangulation::n_cells () const { - unsigned int n=0; - for (unsigned int l=0; l unsigned int Triangulation::n_active_cells () const { - unsigned int n=0; - for (unsigned int l=0; l (Wolfgang Bangerth 2009/11/22)