]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
new version of MGTools::count_dofs_per_component
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Jun 2005 21:05:36 +0000 (21:05 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 23 Jun 2005 21:05:36 +0000 (21:05 +0000)
git-svn-id: https://svn.dealii.org/trunk@10933 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/include/multigrid/mg_tools.h
deal.II/deal.II/source/multigrid/mg_dof_tools.cc
deal.II/deal.II/source/multigrid/mg_transfer_block.cc
deal.II/doc/authors.html
deal.II/doc/news/changes.html

index 6be53cc6c19bc631915e3317c2dfbf904212dc64..dc9fdd925d6ecf0a87d759c4790964f987e66ca4 100644 (file)
@@ -149,10 +149,11 @@ class MGTools
                                      * <tt>result[level][component]</tt>).
                                      */
     template <int dim>
-      static void count_dofs_per_component (const MGDoFHandler<dim> &mg_dof,
-                                           std::vector<std::vector<unsigned int> > &result,
-                                           std::vector<unsigned int> target_component
-                                           = std::vector<unsigned int>());
+      static void count_dofs_per_component (
+       const MGDoFHandler<dim> &mg_dof,
+       std::vector<std::vector<unsigned int> > &result,
+       const bool only_once = false,
+       std::vector<unsigned int> target_component = std::vector<unsigned int>());
     
     
                                     /**
index 39e716efff8ce8c572f1fc9833f90fd0ddf5207b..ea7cbfd480b616703f5241605af7ea33f586951f 100644 (file)
@@ -449,15 +449,16 @@ void
 MGTools::count_dofs_per_component (
   const MGDoFHandler<dim> &dof_handler,
   std::vector<std::vector<unsigned int> > &result,
+  bool only_once,
   std::vector<unsigned int> target_component)
 {
+  const FiniteElement<dim>& fe = dof_handler.get_fe();
+  const unsigned int n_components = fe.n_components();
   const unsigned int nlevels = dof_handler.get_tria().n_levels();
   
   Assert (result.size() == nlevels,
          ExcDimensionMismatch(result.size(), nlevels));
-
-  const unsigned int n_components = dof_handler.get_fe().n_components();
-
+  
   if (target_component.size() == 0)
     {
       target_component.resize(n_components);
@@ -502,16 +503,30 @@ MGTools::count_dofs_per_component (
              component_select[i][i] = true;
              threads += Threads::spawn (fun_ptr)(l, dof_handler, component_select[i],
                                                   dofs_in_component[i]);
-           };
+           }
          threads.join_all();
 
                                           // next count what we got
-         for (unsigned int i=0; i<n_components; ++i)
-             result[l][target_component[i]]
-               += std::count(dofs_in_component[i].begin(),
-                            dofs_in_component[i].end(),
-                            true);
-         
+         unsigned int component = 0;
+         for (unsigned int b=0;b<fe.n_base_elements();++b)
+           {
+             const FiniteElement<dim>& base = fe.base_element(b);
+                                              // Dimension of base element
+             unsigned int d = base.n_components();
+             
+             for (unsigned int m=0;m<fe.element_multiplicity(b);++m)
+               {
+                 for (unsigned int dd=0;dd<d;++dd)
+                   {
+                     if (base.is_primitive() || (!only_once || dd==0))
+                       result[l][target_component[component]]
+                         += std::count(dofs_in_component[component].begin(),
+                                       dofs_in_component[component].end(),
+                                       true);
+                     ++component;
+                   }
+               }
+           }
                                           // finally sanity check
          Assert (!dof_handler.get_fe().is_primitive()
                  ||
@@ -591,7 +606,7 @@ MGTools::reinit_vector (const MGDoFHandler<dim> &mg_dof,
     ndofs(mg_dof.get_tria().n_levels(),
          std::vector<unsigned int>(target_component.size()));
 
-  count_dofs_per_component (mg_dof, ndofs, target_component);
+  count_dofs_per_component (mg_dof, ndofs, true, target_component);
   
   for (unsigned int level=v.get_minlevel();
        level<=v.get_maxlevel();++level)
@@ -640,7 +655,7 @@ MGTools::reinit_vector (const MGDoFHandler<dim> &mg_dof,
        new_dofs(mg_dof.get_tria().n_levels(),
                 std::vector<unsigned int>(target_component.size()));
       std::swap(ndofs, new_dofs);
-      count_dofs_per_component (mg_dof, ndofs, target_component);
+      count_dofs_per_component (mg_dof, ndofs, true, target_component);
     }
   
   for (unsigned int level=v.get_minlevel();
@@ -710,4 +725,5 @@ template void MGTools::reinit_vector<deal_II_dimension> (
 template void MGTools::count_dofs_per_component<deal_II_dimension> (
   const MGDoFHandler<deal_II_dimension>&,
   std::vector<std::vector<unsigned int> >&,
+  bool,
   std::vector<unsigned int>);
index c7d9aac3f412080a3451733235b1f25b0f674cd6..aba3ca141d7217fdffb1ea6640ce0a799c20d8cf 100644 (file)
@@ -85,7 +85,7 @@ void MGTransferBlockBase::build_matrices (
                                   // vector don't have holes.
   const unsigned int n_components  =
     *std::max_element(mg_target_component.begin(), mg_target_component.end()) + 1;
-  const unsigned int dofs_per_cell = fe.dofs_per_cell;  
+  const unsigned int dofs_per_cell = fe.dofs_per_cell;
   const unsigned int n_levels      = mg_dof.get_tria().n_levels();
   
   Assert (mg_selected.size() == fe.n_components(),
@@ -93,7 +93,7 @@ void MGTransferBlockBase::build_matrices (
   
                                   // Compute the lengths of all blocks
   sizes.resize(n_levels);
-  MGTools::count_dofs_per_component(mg_dof, sizes, mg_target_component);
+  MGTools::count_dofs_per_component(mg_dof, sizes, true, mg_target_component);
 
                                   // Fill some index vectors
                                   // for later use.
@@ -597,6 +597,3 @@ MGTransferSelect<double>::copy_from_mg_add (
   const MGDoFHandler<deal_II_dimension>&,
   BlockVector<double>&,
   const MGLevelObject<Vector<double> >&) const;
-
-
-
index 1ed9e3c6b60b9cbec29427eeca069a0e73e0a970..92913d3c10709776f1f6037078f759ab4b7c6165 100644 (file)
@@ -3,42 +3,41 @@
 <html>
 <head>
   <link href="screen.css" rel="StyleSheet" media="screen">
-  <title>Contributors to deal.II</title>
+  <title>Credits for deal.II</title>
   <meta name="author" content="the deal.II authors <authors@dealii.org>">
+  <meta name="copyright" content="Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005 by the deal.II authors">
+  <meta name="date" content="$Date$">
   <meta name="keywords" content="deal.II">
   <meta name="CVS_ID" content="$Id$">
 
 </head>
 <body>
-<h2>Contributors to <acronym>deal.II</acronym></h2>
+<h1>Credits for deal.II</h1>
 
-The library is maintained and mostly written by the
-<acronym>deal.II</acronym> authors:
+<h2>The deal.II authors</h2>
 
-    <dl>
-    <dt><a href="http://www.ices.utexas.edu/~bangerth"
+<p>
+<ul>
+  <li>
+    <a href="http://www.ices.utexas.edu/~bangerth"
     target="_top">Wolfgang Bangerth</a>
+  </li>
 
-    <dd> started the original design and coding
-    of <acronym>deal.II</acronym> in early 1998 and keeps maintaining
-    and improving the library.
-    
-    <dt><a href="http://gaia.iwr.uni-heidelberg.de/~kanschat/"
-    target="_top">Guido Kanschat</a>
-
-    <dd> contributed experience from earlier object-oriented finite
-    element software projects from the beginning and joined in coding
-    later.
-
-    <dt><a href="http://ganymed.iwr.uni-heidelberg.de/~hartmann/"
+  <li>
+    <a href="http://ganymed.iwr.uni-heidelberg.de/~hartmann/"
     target="_top">Ralf Hartmann</a>
+  </li>
 
-    <dd> started contributing code in 1999 while in Heidelberg and joined in
-    maintaining the library.
-    </dl>
+  <li>
+    <a href="http://kanschat.dgfem.net"
+    target="_top">Guido Kanschat</a>
+  </li>
+</ul>
+</p>
 
-    <p>
+<h2>The deal.II contributors</h2>
 
+<p>
     The following people contributed major parts of the library (in
     alphabetical order):
     <ul>
@@ -94,11 +93,14 @@ The library is maintained and mostly written by the
     <li><em>Franz-Theo Suttmeier:</em>
         Initial parts of the linear algebra.
     </ul>
+</p>
+
+<h2>The deal.II mailing list members</h2>
 
-    <p>
-    Furthermore, we thank the numerous people sending in comments,
-    patches and even single functions, but who are not listed above.
-    </p>
+<p>
+  We thank the numerous people sending questions, suggestions, bug reports, bug
+  fixes and improvements. deal.II would be much less without their contribution.
+</p>
 
 </body>
 </html>
\ No newline at end of file
index 63680978cef5772f431076768ea5e3bbea21ada2..fd969d65532dbdf9af44591a2ebf99bf5c33748c 100644 (file)
@@ -42,16 +42,6 @@ inconvenience this causes.
 
 
 <ol>
-  <li> <p>Improved: The function <code class="class">DoFTools</code>::<code
-  class="member">count_dofs_per_component</code> got an additional
-  argument. This argument allows to count the degrees of freedom of
-  nonprimitive vector valued elements only once, instead of in every component.
-  Although this argument defaults to the previous behavior, it had to be put
-  into the argument list ahead of <tt>target_component</tt> in order to make
-  use of default arguments more efficiently.
-  <br> (GK 2005/06/17)
-  </p>
-
   <li> <p>Changed: The way boundary constraints were handled in the step-17
   tutorial program was conceptually flawed. We tried to eliminate boundary
   nodes locally on the cell level, and hanging node constraints subsequently
@@ -438,6 +428,18 @@ inconvenience this causes.
 <h3>deal.II</h3>
 
 <ol>
+  <li> <p>Improved: The function <code class="class">DoFTools</code>::<code
+  class="member">count_dofs_per_component</code> and its counterpart
+  in <code class="class">MGTools</code> got an additional
+  argument. This argument allows to count the degrees of freedom of
+  nonprimitive vector valued elements only once, instead of in every component.
+  Although this argument defaults to the previous behavior, it had to be put
+  into the argument list ahead of <tt>target_component</tt> in order to make
+  use of default arguments more efficiently. The old order of
+  arguments can still be used through a wrapper function.
+  <br> (GK 2005/06/22)
+  </p>
+
   <li> <p>
        Improved: The <code class="class">GeometryInfo</code>::<code
        class="member">child_cell_on_face</code>, <code

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.