]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add FiniteElementBase::n_dofs_per_object<structdim>
authorkayser-herold <kayser-herold@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 28 Jul 2006 15:16:17 +0000 (15:16 +0000)
committerkayser-herold <kayser-herold@0785d39b-7218-0410-832d-ea1e28bc413d>
Fri, 28 Jul 2006 15:16:17 +0000 (15:16 +0000)
git-svn-id: https://svn.dealii.org/trunk@13465 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/fe/fe_base.h
deal.II/doc/news/changes.html

index 929528a24d262a4512342c3beaa84666c5eb4caa..a217b2f4609ec0824ef38b03ad6ae24862bddcc2 100644 (file)
@@ -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 <int structdim>
+    unsigned int n_dofs_per_object () const;
+    
                                     /**
                                      * Number of components.
                                      */
@@ -509,6 +528,30 @@ FiniteElementData<dim>::n_dofs_per_cell () const
 }
 
 
+
+template <int dim>
+template <int structdim>
+inline
+unsigned int
+FiniteElementData<dim>::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 <int dim>
 inline
 unsigned int 
index c25d9e5bc036d0bf2a731d80ea0887cac39d24d4..381ab0b664a97af193fb34efdf3823c44ac4595f 100644 (file)
@@ -734,7 +734,18 @@ inconvenience this causes.
 
 <ol>
   <li> <p>
-       Changed: <code 
+       New: The new function <code class="class">FiniteElementBase</code>::<code
+       class="member">n_dofs_per_object</code> returns either
+       <code>dofs_per_vertex</code>, <code>dofs_per_line</code>,
+       <code>dofs_per_quad</code>, ..., depending on the explicitly
+       specified function template argument. This is often useful for
+       template trickery.
+       <br> 
+       (WB, 2006/07/28)
+       </p>
+
+  <li> <p>
+       Fixed: <code 
                 class="member">Triangulation&lt;dim&gt;::fix_coarsen_flags</code>
        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()</code> and <code
        class="class">TriaObjectAccessor&lt;2,dim&gt;</code>::<code
        class="member">quads()</code> functions. By using these
-       functions, 30 function specializations could have been removed,
+       functions, 30 function specializations could be removed,
        significantly reducing code duplication.
        <br>
        (RH 2006/06/13)

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.