]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Merge from upstream.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Aug 2012 14:37:02 +0000 (14:37 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Aug 2012 14:37:02 +0000 (14:37 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_3@25941 0785d39b-7218-0410-832d-ea1e28bc413d

1  2 
deal.II/include/deal.II/dofs/dof_tools.h
deal.II/include/deal.II/hp/dof_handler.h
deal.II/include/deal.II/multigrid/mg_tools.h
deal.II/source/dofs/dof_tools.cc

index b1695498e03c2be1bb9de910d6045bcb3e415a0b,b1695498e03c2be1bb9de910d6045bcb3e415a0b..d968ab4c28d7736c3726462b508cccde23451717
@@@ -173,11 -173,11 +173,11 @@@ namespace MGTool
                                      * for each block (access is
                                      * <tt>result[level][block]</tt>).
                                      */
--  template <int dim, int spacedim>
++  template <class DH>
    void
--  count_dofs_per_block (const MGDoFHandler<dim,spacedim> &mg_dof,
--                        std::vector<std::vector<unsigned int> > &result,
--                        std::vector<unsigned int> target_block = std::vector<unsigned int>());
++  count_dofs_per_block (const DH&     dof_handler,
++                      std::vector<std::vector<unsigned int> >& dofs_per_block,
++                      std::vector<unsigned int>  target_block);
  
                                     /**
                                      * Count the dofs component-wise
index b91603fb0ca14893aa83f7b438903fd1a833c2f3,b385dd908b37998a6d98a2e628594c234c25b5a5..85c08f4f0e42a6bd4869fa55e641eb9664be0bda
@@@ -3463,40 -3471,54 +3471,54 @@@ namespace DoFTool
      inline
      void
      extract_dofs_by_component (const DH                   &dof,
 -                               const std::vector<bool>    &component_select,
 -                               const bool                  sort_by_blocks,
 -                               std::vector<unsigned char> &dofs_by_component)
 +                                         const std::vector<bool>    &component_select,
 +                                         const bool                  sort_by_blocks,
 +                                         std::vector<unsigned char> &dofs_by_component)
      {
        const dealii::hp::FECollection<DH::dimension,DH::space_dimension>
 -        fe_collection (dof.get_fe());
 +          fe_collection (dof.get_fe());
        Assert (fe_collection.n_components() < 256, ExcNotImplemented());
        Assert (dofs_by_component.size() == dof.n_locally_owned_dofs(),
 -              ExcDimensionMismatch(dofs_by_component.size(),
 -                                   dof.n_locally_owned_dofs()));
 +                ExcDimensionMismatch(dofs_by_component.size(),
 +                                                 dof.n_locally_owned_dofs()));
  
-                                        // next set up a table for the
-                                        // degrees of freedom on each of
-                                        // the cells whether it is
-                                        // something interesting or not
+                                        // next set up a table for the degrees
+                                        // of freedom on each of the cells
+                                        // (regardless of the fact whether it
+                                        // is listed in the component_select
+                                        // argument or not)
+                                      //
+                                      // for each element 'f' of the
+                                      // FECollection,
+                                      // local_component_association[f][d]
+                                      // then returns the vector component
+                                      // that degree of freedom 'd' belongs
+                                      // to (or, in the case of
+                                      // sort_by_blocks, the block that it
+                                      // corresponds to)
        std::vector<std::vector<unsigned char> > local_component_association
 -        (fe_collection.size());
 +          (fe_collection.size());
        for (unsigned int f=0; f<fe_collection.size(); ++f)
-           {
-             const FiniteElement<DH::dimension,DH::space_dimension> &fe =
-               fe_collection[f];
-             local_component_association[f].resize(fe.dofs_per_cell);
-             if (sort_by_blocks == true)
-               {
-                 for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-                       local_component_association[f][i]
-                         = fe.system_to_block_index(i).first;
-               }
-             else
-               for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
-                 if (fe.is_primitive(i))
-                       local_component_association[f][i] =
-                         fe.system_to_component_index(i).first;
-                 else
+         {
+           const FiniteElement<DH::dimension,DH::space_dimension> &fe =
+             fe_collection[f];
+           local_component_association[f].resize(fe.dofs_per_cell);
+           if (sort_by_blocks == true)
+                                            // compute the block each
+                                            // local dof belongs to
+             {
+               for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+                 local_component_association[f][i]
+                   = fe.system_to_block_index(i).first;
+             }
+           else
+                                            // compute the component each
+                                            // local dof belongs to
+             for (unsigned int i=0; i<fe.dofs_per_cell; ++i)
+               if (fe.is_primitive(i))
+                 local_component_association[f][i] =
+                   fe.system_to_component_index(i).first;
+               else
                                                   // if this shape function is
                                                   // not primitive, then we have
                                                   // to work harder. we have to

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.