From 16585b0c88d0452bd7d486ea5292695f18d1747c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 19 Jun 2014 23:34:38 +0000 Subject: [PATCH] Patch by Denis Davydov: Introduce n_global_active_cells() also in dealii::Triangulation. git-svn-id: https://svn.dealii.org/trunk@33062 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/doc/news/changes.h | 5 +++++ deal.II/include/deal.II/distributed/tria.h | 2 +- deal.II/include/deal.II/grid/tria.h | 10 ++++++++++ deal.II/source/grid/tria.cc | 7 +++++++ 4 files changed, 23 insertions(+), 1 deletion(-) diff --git a/deal.II/doc/news/changes.h b/deal.II/doc/news/changes.h index 7b1c9edc11..957f6ddb4d 100644 --- a/deal.II/doc/news/changes.h +++ b/deal.II/doc/news/changes.h @@ -162,6 +162,11 @@ inconvenience this causes. (Denis Davydov, 2014/06/15) +
  • New: There is now function Triangulation::n_global_active_cells(). +
    + (Denis Davydov, 2014/06/19) +
  • +
  • New: There is now a class FEEvaluationQ_DG0 that does optimized matrix-free evaluation for FE_Q_DG0 elements.
    diff --git a/deal.II/include/deal.II/distributed/tria.h b/deal.II/include/deal.II/distributed/tria.h index 7e0f4e06db..ea3e88bc09 100644 --- a/deal.II/include/deal.II/distributed/tria.h +++ b/deal.II/include/deal.II/distributed/tria.h @@ -492,7 +492,7 @@ namespace parallel * cells owned by each processor. This equals the overall number * of active cells in the distributed triangulation. */ - types::global_dof_index n_global_active_cells () const; + virtual types::global_dof_index n_global_active_cells () const; /** * Returns the global maximum level. This may be bigger than diff --git a/deal.II/include/deal.II/grid/tria.h b/deal.II/include/deal.II/grid/tria.h index f60fd6e545..a8f7154342 100644 --- a/deal.II/include/deal.II/grid/tria.h +++ b/deal.II/include/deal.II/grid/tria.h @@ -2850,6 +2850,16 @@ public: */ unsigned int n_active_cells () const; + /** + * Return the total number of active cells. For the current class, this is + * the same as n_active_cells(). However, the function may be overloaded in + * derived classes (e.g., in parallel::distributed::Triangulation) where it + * may return a value greater than the number of active cells reported by + * the triangulation object on the current processor. + */ + virtual types::global_dof_index n_global_active_cells () const; + + /** * Return total number of active cells on * level @p level. Maps to diff --git a/deal.II/source/grid/tria.cc b/deal.II/source/grid/tria.cc index 2193762bea..6d1a054920 100644 --- a/deal.II/source/grid/tria.cc +++ b/deal.II/source/grid/tria.cc @@ -11462,6 +11462,13 @@ unsigned int Triangulation::n_active_cells () const return internal::Triangulation::n_active_cells (number_cache); } +template +types::global_dof_index Triangulation::n_global_active_cells () const +{ + return n_active_cells(); +} + + template unsigned int Triangulation::n_faces () const -- 2.39.5