From 543c9477ba50f77e0552d6f29d228b4c70fcd8c8 Mon Sep 17 00:00:00 2001 From: kayser-herold Date: Fri, 28 Jul 2006 15:16:17 +0000 Subject: [PATCH] Add FiniteElementBase::n_dofs_per_object git-svn-id: https://svn.dealii.org/trunk@13465 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/include/fe/fe_base.h | 43 ++++++++++++++++++++++++++++ deal.II/doc/news/changes.html | 15 ++++++++-- 2 files changed, 56 insertions(+), 2 deletions(-) diff --git a/deal.II/deal.II/include/fe/fe_base.h b/deal.II/deal.II/include/fe/fe_base.h index 929528a24d..a217b2f460 100644 --- a/deal.II/deal.II/include/fe/fe_base.h +++ b/deal.II/deal.II/include/fe/fe_base.h @@ -361,6 +361,25 @@ class FiniteElementData */ unsigned int n_dofs_per_cell () const; + /** + * Return the number of degrees + * per structdim-dimensional + * object. For structdim==0, the + * function therefore returns + * dofs_per_vertex, for + * structdim==1 dofs_per_line, + * etc. This function is mostly + * used to allow some template + * trickery for functions that + * should work on all sorts of + * objects without wanting to use + * the different names (vertex, + * line, ...) associated with + * these objects. + */ + template + unsigned int n_dofs_per_object () const; + /** * Number of components. */ @@ -509,6 +528,30 @@ FiniteElementData::n_dofs_per_cell () const } + +template +template +inline +unsigned int +FiniteElementData::n_dofs_per_object () const +{ + switch (structdim) + { + case 0: + return dofs_per_vertex; + case 1: + return dofs_per_line; + case 2: + return dofs_per_quad; + case 3: + return dofs_per_hex; + default: + Assert (false, ExcInternalError()); + } + return deal_II_numbers::invalid_unsigned_int; +} + + template inline unsigned int diff --git a/deal.II/doc/news/changes.html b/deal.II/doc/news/changes.html index c25d9e5bc0..381ab0b664 100644 --- a/deal.II/doc/news/changes.html +++ b/deal.II/doc/news/changes.html @@ -734,7 +734,18 @@ inconvenience this causes.
  1. - Changed: FiniteElementBase::n_dofs_per_object returns either + dofs_per_vertex, dofs_per_line, + dofs_per_quad, ..., depending on the explicitly + specified function template argument. This is often useful for + template trickery. +
    + (WB, 2006/07/28) +

    + +
  2. + Fixed: Triangulation<dim>::fix_coarsen_flags has been modified to allow coarsening in all possible cases. Up to now, coarsening was forbidden, if the neighbor cell was not refined @@ -753,7 +764,7 @@ inconvenience this causes. class="member">lines() and TriaObjectAccessor<2,dim>::quads() functions. By using these - functions, 30 function specializations could have been removed, + functions, 30 function specializations could be removed, significantly reducing code duplication.
    (RH 2006/06/13) -- 2.39.5