]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Merge from mainline.
authorbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Aug 2012 14:33:42 +0000 (14:33 +0000)
committerbangerth <bangerth@0785d39b-7218-0410-832d-ea1e28bc413d>
Mon, 13 Aug 2012 14:33:42 +0000 (14:33 +0000)
git-svn-id: https://svn.dealii.org/branches/branch_merge_mg_into_dof_handler@25939 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/source/dofs/dof_tools.cc

index b6cf7089a48f4ab51194fb87ee59ae16014a0397,b385dd908b37998a6d98a2e628594c234c25b5a5..283005dee839fec342c70edd753b0133a49a1066
@@@ -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.