const MGDoFHandler<dim>::active_cell_iterator
level_end = mg_dof_handler->end_active(level);
+//TODO: Treat hanging nodes properly
+// The single-level vector is not an FE-function, because the values at
+// hanging nodes are set to zero. This should be treated before the restriction.
+
+ // Compute coarse level right hand side
+ // by restricting from fine level.
for (; level_cell!=level_end; ++level_cell, ++global_cell)
{
// get the dof numbers of
for (unsigned int i=0; i<dofs_per_cell; ++i)
defect[level](level_dof_indices[i]) = src(global_dof_indices[i]);
-//TODO: what happens here?
- // Delete values on refinement edge
+ // Delete values on refinement edge,
+ // since restriction will add them again.
for (unsigned int face_n=0; face_n<GeometryInfo<dim>::faces_per_cell; ++face_n)
{
const MGDoFHandler<dim>::face_iterator face = level_cell->face(face_n);
--- /dev/null
+//---------------------------- multigrid.all_dimensions.cc ---------------------------
+// $Id$
+// Version: $Name$
+//
+// Copyright (C) 1998, 1999, 2000 by the deal.II authors
+//
+// This file is subject to QPL and may not be distributed
+// without copyright and license information. Please refer
+// to the file deal.II/doc/license.html for the text and
+// further information on this license.
+//
+//---------------------------- multigrid.all_dimensions.cc ---------------------------
+
+
+
+#include <grid/tria.h>
+#include <multigrid/mg_dof_handler.h>
+#include <multigrid/mg_dof_accessor.h>
+#include <grid/tria_iterator.h>
+#include <fe/fe.h>
+#include <multigrid/multigrid.h>
+#include <multigrid/multigrid.templates.h>
+#include <multigrid/mg_smoother.h>
+#include <lac/vector.h>
+
+
+MGTransferPrebuilt::~MGTransferPrebuilt ()
+{};
+
+
+void MGTransferPrebuilt::prolongate (const unsigned int to_level,
+ Vector<double> &dst,
+ const Vector<double> &src) const
+{
+ Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()),
+ ExcIndexRange (to_level, 1, prolongation_matrices.size()+1));
+
+ prolongation_matrices[to_level-1].vmult (dst, src);
+};
+
+
+void MGTransferPrebuilt::restrict_and_add (const unsigned int from_level,
+ Vector<double> &dst,
+ const Vector<double> &src) const
+{
+ Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
+ ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
+
+ prolongation_matrices[from_level-1].Tvmult_add (dst, src);
+};
+
+
/* ----------------------------- MGTransferPrebuilt ------------------------ */
-MGTransferPrebuilt::~MGTransferPrebuilt ()
-{};
-
-
template <int dim>
void MGTransferPrebuilt::build_matrices (const MGDoFHandler<dim> &mg_dof)
{
};
-void MGTransferPrebuilt::prolongate (const unsigned int to_level,
- Vector<double> &dst,
- const Vector<double> &src) const
-{
- Assert ((to_level >= 1) && (to_level<=prolongation_matrices.size()),
- ExcIndexRange (to_level, 1, prolongation_matrices.size()+1));
-
- prolongation_matrices[to_level-1].vmult (dst, src);
-};
-
-
-void MGTransferPrebuilt::restrict_and_add (const unsigned int from_level,
- Vector<double> &dst,
- const Vector<double> &src) const
-{
- Assert ((from_level >= 1) && (from_level<=prolongation_matrices.size()),
- ExcIndexRange (from_level, 1, prolongation_matrices.size()+1));
-
- prolongation_matrices[from_level-1].Tvmult_add (dst, src);
-};
-
-
// explicit instatations
template class Multigrid<deal_II_dimension>;
template