From: Bruno Turcksin <bruno.turcksin@gmail.com>
Date: Mon, 3 Jun 2013 14:09:16 +0000 (+0000)
Subject: Merge from mainline.
X-Git-Tag: v8.0.0~316^2~5
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=80480aa662b72cfe5f1704a17c74219d2f46fa9f;p=dealii.git

Merge from mainline.

git-svn-id: https://svn.dealii.org/branches/branch_bigger_global_dof_indices_4@29740 0785d39b-7218-0410-832d-ea1e28bc413d
---

80480aa662b72cfe5f1704a17c74219d2f46fa9f
diff --cc deal.II/include/deal.II/dofs/dof_accessor.h
index ee733aee95,cd438a8fc6..29b9cca9f3
--- a/deal.II/include/deal.II/dofs/dof_accessor.h
+++ b/deal.II/include/deal.II/dofs/dof_accessor.h
@@@ -368,45 -368,41 +368,43 @@@ public
     */
  
    /**
 -   * Return the indices of the dofs of this object in the standard
 -   * ordering: dofs on vertex 0, dofs on vertex 1, etc, dofs on line
 -   * 0, dofs on line 1, etc, dofs on quad 0, etc.
 +   * Return the <i>global</i> indices of the degrees of freedom located on
 +   * this object in the standard ordering defined by the finite element (i.e.,
 +   * dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1,
 +   * etc, dofs on quad 0, etc.) This function is only available on
 +   * <i>active</i> objects (see @ref GlossActive "this glossary entry").
     *
-    * @param[out] dof_indices The vector into which the indices will be
-    *     written. It has to have the right size (namely,
-    *     <code>fe.dofs_per_cell</code>, <code>fe.dofs_per_face</code>,
-    *     or <code>fe.dofs_per_line</code>, depending on which kind of
-    *     object this function is called) before being passed to this
-    *     function.
-    * @param[in] fe_index The finite element index. For the   
-    *     standard ::DoFHandler class, this value must be equal to its default
-    *     value since that class only supports the same finite element on all
-    *     cells anyway. However, for hp objects (i.e. the hp::DoFHandler
-    *     class), different finite element objects may be used on different
-    *     cells. On faces between two cells, as well as vertices, there may
-    *     therefore be two sets of degrees of freedom, one for each of the
-    *     finite elements used on the adjacent cells. In order to specify which
-    *     set of degrees of freedom to work on, the last argument is used to
-    *     disambiguate. Finally, if this function is called for a cell object,
-    *     there can only be a single set of degrees of freedom, and fe_index
-    *     has to match the result of active_fe_index(). (Consequently,
-    *     the derived DoFCellAccessor class has an overloaded version of this
-    *     function that calls the present function with
-    *     <code>cell-@>active_fe_index</code> as last argument.)
-    *
-    *
-    * @note In many places in the tutorial and elsewhere in the library, the
-    *   first argument to this function is called
-    *   <code>local_dof_indices</code> by convention. The name is not meant to
-    *   indicate the <i>local</i> numbers of degrees of freedom (which are
-    *   always between zero and <code>fe.dofs_per_cell</code>, or similar faces
-    *   or edges) but instead that the returned values are the <i>global</i>
-    *   indices of those degrees of freedom that are located locally on the
-    *   current cell, face or edge.
+    * The cells needs to be an active cell (and not artificial in a
+    * parallel distributed computation).
+    *
+    * The vector has to have the right size before being passed to this
+    * function.
+    *
+    * The last argument denotes the finite element index. For the
+    * standard ::DoFHandler class, this value must be equal to its
+    * default value since that class only supports the same finite
+    * element on all cells anyway.
+    *
+    * However, for hp objects (i.e. the hp::DoFHandler class),
+    * different finite element objects may be used on different
+    * cells. On faces between two cells, as well as vertices, there may
+    * therefore be two sets of degrees of freedom, one for each of the
+    * finite elements used on the adjacent cells. In order to specify
+    * which set of degrees of freedom to work on, the last argument is
+    * used to disambiguate. Finally, if this function is called for a
+    * cell object, there can only be a single set of degrees of
+    * freedom, and fe_index has to match the result of
+    * active_fe_index().
+    *
+    * For cells, there is only a single possible finite element index
+    * (namely the one for that cell, returned by
+    * <code>cell-@>active_fe_index</code>. Consequently, the derived
+    * DoFCellAccessor class has an overloaded version of this function
+    * that calls the present function with
+    * <code>cell-@>active_fe_index</code> as last argument.
+    *
     */
 -  void get_dof_indices (std::vector<unsigned int> &dof_indices,
 +  void get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
                          const unsigned int fe_index = DH::default_fe_index) const;
  
    /**
@@@ -1072,35 -1070,64 +1070,64 @@@ public
     */
  
    /**
 -   * Return the indices of the dofs of this
 -   * object in the standard ordering: dofs
 -   * on vertex 0, dofs on vertex 1, etc,
 -   * dofs on line 0, dofs on line 1, etc,
 -   * dofs on quad 0, etc.
 +   * Return the <i>global</i> indices of the degrees of freedom located on
 +   * this object in the standard ordering defined by the finite element (i.e.,
 +   * dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1,
 +   * etc, dofs on quad 0, etc.) This function is only available on
 +   * <i>active</i> objects (see @ref GlossActive "this glossary entry").
     *
-    * @param[out] dof_indices The vector into which the indices will be
-    *     written. It has to have the right size (namely,
-    *     <code>fe.dofs_per_cell</code>, <code>fe.dofs_per_face</code>,
-    *     or <code>fe.dofs_per_line</code>, depending on which kind of
-    *     object this function is called) before being passed to this
-    *     function.
-    * @param[in] fe_index The finite element index. For the   
-    *     standard ::DoFHandler class, this value must be equal to its default
-    *     value since that class only supports the same finite element on all
-    *     cells anyway. However, for hp objects (i.e. the hp::DoFHandler
-    *     class), different finite element objects may be used on different
-    *     cells. On faces between two cells, as well as vertices, there may
-    *     therefore be two sets of degrees of freedom, one for each of the
-    *     finite elements used on the adjacent cells. In order to specify which
-    *     set of degrees of freedom to work on, the last argument is used to
-    *     disambiguate. Finally, if this function is called for a cell object,
-    *     there can only be a single set of degrees of freedom, and fe_index
-    *     has to match the result of active_fe_index(). (Consequently,
-    *     the derived DoFCellAccessor class has an overloaded version of this
-    *     function that calls the present function with
-    *     <code>cell-@>active_fe_index</code> as last argument.)
+    * The cells needs to be an active cell (and not artificial in a
+    * parallel distributed computation).
+    *
+    * The vector has to have the
+    * right size before being passed
+    * to this function.
+    *
+    * The last argument denotes the
+    * finite element index. For the
+    * standard ::DoFHandler class,
+    * this value must be equal to
+    * its default value since that
+    * class only supports the same
+    * finite element on all cells
+    * anyway.
+    *
+    * However, for hp objects
+    * (i.e. the hp::DoFHandler
+    * class), different finite
+    * element objects may be used on
+    * different cells. On faces
+    * between two cells, as well as
+    * vertices, there may therefore
+    * be two sets of degrees of
+    * freedom, one for each of the
+    * finite elements used on the
+    * adjacent cells. In order to
+    * specify which set of degrees
+    * of freedom to work on, the
+    * last argument is used to
+    * disambiguate. Finally, if this
+    * function is called for a cell
+    * object, there can only be a
+    * single set of degrees of
+    * freedom, and fe_index has to
+    * match the result of
+    * active_fe_index().
+    *
+    * For cells, there is only a
+    * single possible finite element
+    * index (namely the one for that
+    * cell, returned by
+    * <code>cell-@>active_fe_index</code>. Consequently,
+    * the derived DoFCellAccessor
+    * class has an overloaded
+    * version of this function that
+    * calls the present function
+    * with
+    * <code>cell-@>active_fe_index</code>
+    * as last argument.
     */
 -  void get_dof_indices (std::vector<unsigned int> &dof_indices,
 +  void get_dof_indices (std::vector<types::global_dof_index> &dof_indices,
                          const unsigned int fe_index = AccessorData::default_fe_index) const;
  
    /**
@@@ -2027,40 -2054,42 +2054,42 @@@ public
     *
     * Examples for this use are in the implementation of DoFRenumbering.
     */
 -  void get_active_or_mg_dof_indices (std::vector<unsigned int> &dof_indices) const;
 +  void get_active_or_mg_dof_indices (std::vector<types::global_dof_index> &dof_indices) const;
  
    /**
 -   * Return the indices of the dofs of this
 -   * quad in the standard ordering: dofs
 -   * on vertex 0, dofs on vertex 1, etc,
 -   * dofs on line 0, dofs on line 1, etc,
 -   * dofs on quad 0, etc.
 +   * Return the <i>global</i> indices of the degrees of freedom located on
 +   * this object in the standard ordering defined by the finite element (i.e.,
 +   * dofs on vertex 0, dofs on vertex 1, etc, dofs on line 0, dofs on line 1,
 +   * etc, dofs on quad 0, etc.) This function is only available on
 +   * <i>active</i> objects (see @ref GlossActive "this glossary entry").
 +   *
 +   * @param[out] dof_indices The vector into which the indices will be
 +   *     written. It has to have the right size (namely,
 +   *     <code>fe.dofs_per_cell</code>, <code>fe.dofs_per_face</code>,
 +   *     or <code>fe.dofs_per_line</code>, depending on which kind of
 +   *     object this function is called) before being passed to this
 +   *     function.
     *
 -   * It is assumed that the vector already
 -   * has the right size beforehand.
 -   *
 -   * This function reimplements the
 -   * same function in the base
 -   * class. The functions in the
 -   * base classes are available for
 -   * all geometric objects,
 -   * i.e. even in 3d they can be
 -   * used to access the dof indices
 -   * of edges, for example. On the
 -   * other hand, the most common
 -   * case is clearly the use on
 -   * cells, which is why we cache
 -   * the array for each cell, but
 -   * not edge. To retrieve the
 -   * cached values, rather than
 -   * collect the necessary
 -   * information every time, this
 -   * function overwrites the one in
 -   * the base class.
 +   * This function reimplements the same function in the base class.
 +   * In contrast to the function in the base class, we do not need the
 +   * <code>fe_index</code> here because there is always a unique finite
 +   * element index on cells.
     *
+    * This is a function which requires that the cell is active.
+    *
     * Also see get_active_or_mg_dof_indices().
 +   *
 +   * @note In many places in the tutorial and elsewhere in the library,
 +   *   the argument to this function is called <code>local_dof_indices</code>
 +   *   by convention. The name is not meant to indicate the <i>local</i>
 +   *   numbers of degrees of freedom (which are always between zero and
 +   *   <code>fe.dofs_per_cell</code>) but instead that the returned values
 +   *   are the <i>global</i> indices of those degrees of freedom that
 +   *   are located locally on the current cell.
 +   *
 +   * @deprecated Currently, this function can also be called for non-active cells, if all degrees of freedom of the FiniteElement are located in vertices. This functionality will vanish in a future release.
     */
 -  void get_dof_indices (std::vector<unsigned int> &dof_indices) const;
 +  void get_dof_indices (std::vector<types::global_dof_index> &dof_indices) const;
  
    /**
     * @deprecated Use get_active_or_mg_dof_indices() with level_cell_iterator returned from begin_mg().
diff --cc deal.II/include/deal.II/dofs/dof_accessor.templates.h
index 83ef24d839,259eccedac..30132e99bd
--- a/deal.II/include/deal.II/dofs/dof_accessor.templates.h
+++ b/deal.II/include/deal.II/dofs/dof_accessor.templates.h
@@@ -2760,17 -2738,11 +2760,11 @@@ namespace interna
        {
          AssertDimension (dof_indices.size(), accessor.get_fe().dofs_per_cell);
  
-         // check as in documentation that
-         // cell is either active, or dofs
-         // are only in vertices
-         Assert (!accessor.has_children()
-                 ||
-                 (accessor.get_fe().dofs_per_cell ==
-                  accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                 ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+         Assert (!accessor.has_children(),
+                 ExcMessage ("Cell must be active."));
  
 -        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
 -                              ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
 +        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
 +                                         ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
          for (unsigned int i=0; i<accessor.get_fe().dofs_per_cell; ++i, ++cache)
            dof_indices[i] = *cache;
        }
@@@ -2822,18 -2794,12 +2816,12 @@@
          Assert (values.size() == accessor.get_dof_handler().n_dofs(),
                  typename BaseClass::ExcVectorDoesNotMatch());
  
-         // check as in documentation that
-         // cell is either active, or dofs
-         // are only in vertices
-         Assert (!accessor.has_children()
-                 ||
-                 (accessor.get_fe().dofs_per_cell ==
-                  accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                 ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+         Assert (!accessor.has_children(),
+                 ExcMessage ("Cell must be active."));
  
 -        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
 -                              ->cell_dof_indices_cache[accessor.present_index *
 -                                                       accessor.get_fe().dofs_per_cell];
 +        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
 +                                         ->cell_dof_indices_cache[accessor.present_index *
 +                                                                  accessor.get_fe().dofs_per_cell];
          for ( ; local_values_begin != local_values_end; ++local_values_begin, ++cache)
            *local_values_begin = values(*cache);
        }
@@@ -2895,18 -2861,12 +2883,12 @@@
          Assert (values.size() == accessor.get_dof_handler().n_dofs(),
                  typename BaseClass::ExcVectorDoesNotMatch());
  
-         // check as in documentation that
-         // cell is either active, or dofs
-         // are only in vertices
-         Assert (!accessor.has_children()
-                 ||
-                 (accessor.get_fe().dofs_per_cell ==
-                  accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                 ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+         Assert (!accessor.has_children(),
+                 ExcMessage ("Cell must be active."));
  
 -        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
 -                              ->cell_dof_indices_cache[accessor.present_index *
 -                                                       accessor.get_fe().dofs_per_cell];
 +        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
 +                                         ->cell_dof_indices_cache[accessor.present_index *
 +                                                                  accessor.get_fe().dofs_per_cell];
          constraints.get_dof_values(values, *cache, local_values_begin,
                                     local_values_end);
        }
@@@ -2961,17 -2921,11 +2943,11 @@@
          Assert (values.size() == accessor.get_dof_handler().n_dofs(),
                  typename BaseClass::ExcVectorDoesNotMatch());
  
-         // check as in documentation that
-         // cell is either active, or dofs
-         // are only in vertices
-         Assert (!accessor.has_children()
-                 ||
-                 (accessor.get_fe().dofs_per_cell ==
-                  accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                 ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+         Assert (!accessor.has_children(),
+                 ExcMessage ("Cell must be active."));
  
 -        unsigned int *cache = &accessor.dof_handler->levels[accessor.level()]
 -                              ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
 +        types::global_dof_index *cache = &accessor.dof_handler->levels[accessor.level()]
 +                                         ->cell_dof_indices_cache[accessor.present_index * accessor.get_fe().dofs_per_cell];
          for (unsigned int i=0; i<accessor.get_fe().dofs_per_cell; ++i, ++cache)
            values(*cache) = local_values(i);
        }
@@@ -3327,18 -3263,12 +3285,12 @@@
          Assert (accessor.dof_handler->n_dofs() == global_vector.size(),
                  typename BaseClass::ExcVectorDoesNotMatch());
  
-         // check as in documentation that
-         // cell is either active, or dofs
-         // are only in vertices
-         Assert (!accessor.has_children()
-                 ||
-                 (accessor.get_fe().dofs_per_cell ==
-                  accessor.get_fe().dofs_per_vertex * GeometryInfo<dim>::vertices_per_cell),
-                 ExcMessage ("Cell must either be active, or all DoFs must be in vertices"));
+         Assert (!accessor.has_children(),
+                 ExcMessage ("Cell must be active."));
  
          const unsigned int n_dofs = accessor.get_fe().dofs_per_cell;
 -        unsigned int *dofs = &accessor.dof_handler->levels[accessor.level()]
 -                             ->cell_dof_indices_cache[accessor.present_index *n_dofs];
 +        types::global_dof_index *dofs = &accessor.dof_handler->levels[accessor.level()]
 +                                        ->cell_dof_indices_cache[accessor.present_index *n_dofs];
  
          // distribute cell matrices
          for (unsigned int i=0; i<n_dofs; ++i)
@@@ -3551,8 -3481,9 +3503,9 @@@ DoFCellAccessor<DH,lda>::face (const un
  template <class DH, bool lda>
  inline
  void
 -DoFCellAccessor<DH,lda>::get_dof_indices (std::vector<unsigned int> &dof_indices) const
 +DoFCellAccessor<DH,lda>::get_dof_indices (std::vector<types::global_dof_index> &dof_indices) const
  {
+   Assert (this->active(), ExcMessage ("get_dof_indices() only works on active cells."));
    Assert (this->is_artificial() == false,
            ExcMessage ("Can't ask for DoF indices on artificial cells."));
    AssertDimension (dof_indices.size(), this->get_fe().dofs_per_cell);
diff --cc deal.II/include/deal.II/dofs/dof_renumbering.h
index 59c659c31e,0b750d627a..ae80171850
--- a/deal.II/include/deal.II/dofs/dof_renumbering.h
+++ b/deal.II/include/deal.II/dofs/dof_renumbering.h
@@@ -817,11 -817,12 +817,12 @@@ namespace DoFRenumberin
     * the renumbering vector.
     */
    template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
 -  unsigned int
 -  compute_component_wise (std::vector<unsigned int> &new_dof_indices,
 +  types::global_dof_index
 +  compute_component_wise (std::vector<types::global_dof_index> &new_dof_indices,
                            const ITERATOR &start,
                            const ENDITERATOR &end,
-                           const std::vector<unsigned int> &target_component);
+                           const std::vector<unsigned int> &target_component,
+                           bool is_level_operation);
  
    /**
     * @}
diff --cc deal.II/source/dofs/dof_renumbering.cc
index 420ad7843f,f7d9e8796e..979cd02e91
--- a/deal.II/source/dofs/dof_renumbering.cc
+++ b/deal.II/source/dofs/dof_renumbering.cc
@@@ -559,10 -558,10 +559,10 @@@ namespace DoFRenumberin
      typename DH::level_cell_iterator start =dof_handler.begin(level);
      typename DH::level_cell_iterator end = dof_handler.end(level);
  
 -    const unsigned int result =
 +    const types::global_dof_index result =
        compute_component_wise<DH::dimension, DH::space_dimension,
        typename DH::level_cell_iterator, typename DH::level_cell_iterator>
-       (renumbering, start, end, component_order_arg);
+       (renumbering, start, end, component_order_arg, true);
  
      if (result == 0) return;
  
@@@ -576,11 -575,12 +576,12 @@@
  
  
    template <int dim, int spacedim, class ITERATOR, class ENDITERATOR>
 -  unsigned int
 -  compute_component_wise (std::vector<unsigned int> &new_indices,
 +  types::global_dof_index
 +  compute_component_wise (std::vector<types::global_dof_index> &new_indices,
                            const ITERATOR    &start,
                            const ENDITERATOR &end,
-                           const std::vector<unsigned int> &component_order_arg)
+                           const std::vector<unsigned int> &component_order_arg,
+                           bool is_level_operation)
    {
      const hp::FECollection<dim,spacedim>
      fe_collection (start->get_dof_handler().get_fe ());
@@@ -658,23 -658,37 +659,37 @@@
      // dof indices are entered
      // multiply, so we will have to
      // take care of that
 -    std::vector<std::vector<unsigned int> >
 +    std::vector<std::vector<types::global_dof_index> >
      component_to_dof_map (fe_collection.n_components());
      for (ITERATOR cell=start; cell!=end; ++cell)
-       if (cell->is_locally_owned())
-         {
-           // on each cell: get dof indices
-           // and insert them into the global
-           // list using their component
-           const unsigned int fe_index = cell->active_fe_index();
-           const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
-           local_dof_indices.resize (dofs_per_cell);
-           cell->get_active_or_mg_dof_indices (local_dof_indices);
-           for (unsigned int i=0; i<dofs_per_cell; ++i)
-             if (start->get_dof_handler().locally_owned_dofs().is_element(local_dof_indices[i]))
-               component_to_dof_map[component_list[fe_index][i]].
-               push_back (local_dof_indices[i]);
-         }
+       {
+         if (is_level_operation)
+           {
+             //we are dealing with mg dofs, skip foreign level cells:
+             if ((start->get_dof_handler().get_tria().locally_owned_subdomain() != numbers::invalid_subdomain_id)
+                 &&
+                 (cell->level_subdomain_id()!=start->get_dof_handler().get_tria().locally_owned_subdomain()))
+               continue;
+           }
+         else
+           {
+             //we are dealing with active dofs, skip the loop if not locally
+             // owned:
+             if (!cell->active() || !cell->is_locally_owned())
+               continue;
+           }
+         // on each cell: get dof indices
+         // and insert them into the global
+         // list using their component
+         const unsigned int fe_index = cell->active_fe_index();
+         const unsigned int dofs_per_cell = fe_collection[fe_index].dofs_per_cell;
+         local_dof_indices.resize (dofs_per_cell);
+         cell->get_active_or_mg_dof_indices (local_dof_indices);
+         for (unsigned int i=0; i<dofs_per_cell; ++i)
+           if (start->get_dof_handler().locally_owned_dofs().is_element(local_dof_indices[i]))
+             component_to_dof_map[component_list[fe_index][i]].
+             push_back (local_dof_indices[i]);
+       }
  
      // now we've got all indices sorted
      // into buckets labeled by their
diff --cc deal.II/source/lac/slepc_solver.cc
index 638f7b0f9d,89d8b900ef..2703bc964c
--- a/deal.II/source/lac/slepc_solver.cc
+++ b/deal.II/source/lac/slepc_solver.cc
@@@ -218,8 -218,8 +218,8 @@@ namespace SLEPcWrapper
    }
  
    void
 -  SolverBase::get_eigenpair (const unsigned int         index,
 +  SolverBase::get_eigenpair (const size_type            index,
-                              double                    &eigenvalues,
+                              PetscScalar               &eigenvalues,
                               PETScWrappers::VectorBase &eigenvectors)
    {
      AssertThrow (solver_data.get() != 0, ExcSLEPcWrappersUsageError());
diff --cc deal.II/source/multigrid/mg_transfer_prebuilt.cc
index 94b5cf7b32,0d54ca3de8..6525146ac6
--- a/deal.II/source/multigrid/mg_transfer_prebuilt.cc
+++ b/deal.II/source/multigrid/mg_transfer_prebuilt.cc
@@@ -247,10 -247,9 +247,9 @@@ void MGTransferPrebuilt<VECTOR>::build_
    copy_indices_to_me.resize(n_levels);
    IndexSet globally_relevant;
    DoFTools::extract_locally_relevant_dofs(mg_dof, globally_relevant);
-   std::vector<bool> dof_touched(globally_relevant.n_elements(), false);
  
 -  std::vector<unsigned int> global_dof_indices (dofs_per_cell);
 -  std::vector<unsigned int> level_dof_indices  (dofs_per_cell);
 +  std::vector<types::global_dof_index> global_dof_indices (dofs_per_cell);
 +  std::vector<types::global_dof_index> level_dof_indices  (dofs_per_cell);
    //  for (int level=mg_dof.get_tria().n_levels()-1; level>=0; --level)
    for (unsigned int level=0; level<mg_dof.get_tria().n_levels(); ++level)
      {
diff --cc tests/mpi/mg_03.cc
index b018be64c7,b249bab4a8..8a0205beef
--- a/tests/mpi/mg_03.cc
+++ b/tests/mpi/mg_03.cc
@@@ -83,41 -83,29 +83,29 @@@ void test(
    dofh.distribute_mg_dofs (fe);
  
    {
-    std::ofstream file((std::string("mg_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
-     file << "**** proc " << myid << std::endl;
-           for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
-             {
-               file << "level " << lvl << ": ";
-               typename DoFHandler<dim>::cell_iterator
-               cell = dofh.begin(lvl),
-               endc = dofh.end(lvl);
- 
-               for (;cell!=endc;++cell)
-                 {
-               std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
-               cell->get_mg_dof_indices(dofs);
- 
-               for (unsigned int i=0;i<dofs.size();++i)
-                 if (dofs[i]==numbers::invalid_dof_index)
-                   file << "- ";
-                 else
-                   file << dofs[i] << " ";
-               file << " | ";
-                 }
-               file << std::endl;
-             }
+     for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
+       {
+ 	deallog << "level " << lvl << ": ";
+ 	typename DoFHandler<dim>::cell_iterator
+ 	  cell = dofh.begin(lvl),
+ 	  endc = dofh.end(lvl);
+ 	
+ 	for (;cell!=endc;++cell)
+ 	  {
 -	    std::vector<unsigned int> dofs(fe.n_dofs_per_cell());
++	    std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
+ 	    cell->get_mg_dof_indices(dofs);
+ 	    
+ 	    for (unsigned int i=0;i<dofs.size();++i)
+ 	      if (dofs[i]==numbers::invalid_dof_index)
+ 		deallog << "- ";
+ 	      else
+ 		deallog << dofs[i] << " ";
+ 	    deallog << " | ";
+ 	  }
+ 	deallog << std::endl;
+       }
    }
  
-   MPI_Barrier(MPI_COMM_WORLD);
- 
-   if (myid==0)
-     {
-       for (unsigned int i=0;i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);++i)
-         {
-           cat_file((std::string("mg_03/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
-         }
-     }      
- 
    if (myid==0)
      deallog << "OK" << std::endl;
  }
diff --cc tests/mpi/mg_04.cc
index a388c08a23,4caa099b32..5198758e8e
--- a/tests/mpi/mg_04.cc
+++ b/tests/mpi/mg_04.cc
@@@ -79,41 -79,29 +79,29 @@@ void test(
    dofh.distribute_mg_dofs (fe);
  
    {
-    std::ofstream file((std::string("mg_04/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(myid)).c_str());
-     file << "**** proc " << myid << std::endl;
-           for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
-             {
-               file << "level " << lvl << ": ";
-               typename DoFHandler<dim>::cell_iterator
-               cell = dofh.begin(lvl),
-               endc = dofh.end(lvl);
- 
-               for (;cell!=endc;++cell)
-                 {
-               std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
-               cell->get_mg_dof_indices(dofs);
- 
-               for (unsigned int i=0;i<dofs.size();++i)
-                 if (dofs[i]==numbers::invalid_dof_index)
-                   file << "- ";
-                 else
-                   file << dofs[i] << " ";
-               file << " | ";
-                 }
-               file << std::endl;
-             }
+     for (unsigned int lvl=0;lvl<tr.n_levels();++lvl)
+       {
+ 	deallog << "level " << lvl << ": ";
+ 	typename DoFHandler<dim>::cell_iterator
+ 	  cell = dofh.begin(lvl),
+ 	  endc = dofh.end(lvl);
+ 	
+ 	for (;cell!=endc;++cell)
+ 	  {
 -	    std::vector<unsigned int> dofs(fe.n_dofs_per_cell());
++	    std::vector<types::global_dof_index> dofs(fe.n_dofs_per_cell());
+ 	    cell->get_mg_dof_indices(dofs);
+ 	    
+ 	    for (unsigned int i=0;i<dofs.size();++i)
+ 	      if (dofs[i]==numbers::invalid_dof_index)
+ 		deallog << "- ";
+ 	      else
+ 		deallog << dofs[i] << " ";
+ 	    deallog << " | ";
+ 	  }
+ 	deallog << std::endl;
+       }
    }
- 
-   MPI_Barrier(MPI_COMM_WORLD);
- 
-   if (myid==0)
-     {
-       for (unsigned int i=0;i<Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD);++i)
-         {
-           cat_file((std::string("mg_04/ncpu_") + Utilities::int_to_string(Utilities::MPI::n_mpi_processes (MPI_COMM_WORLD)) + "/dat." + Utilities::int_to_string(i)).c_str());
-         }
-     }      
- 
+   
    if (myid==0)
      deallog << "OK" << std::endl;
  }