const Vector<double> &src,
const Vector<double> &rhs) = 0;
+ /**
+ * Additional multiplication on a
+ * refinement edge. Using DGFEM,
+ * the application of the global
+ * matrix to a function on the
+ * fine level produces results on
+ * the surrounding cells of the
+ * coarse level. Therefore,
+ * additionally to the fine level
+ * matrix, we need an operator
+ * from the fine level to the
+ * coarse level, taking care of
+ * this multiplication.
+ *
+ * Like @ref{level_vmult}, it is
+ * expected to add the negative
+ * product of the matrix and
+ * @p{src} to @p{dst}. Here,
+ * @p{src} is a vector on the
+ * fine level and @p{dst} is a
+ * vector on the coarse level.
+ *
+ * This function has an empty
+ * implementation here and must
+ * be overloaded in a multigrid
+ * class for discontinuous
+ * methods.
+ */
+ virtual void edge_vmult (const unsigned int level,
+ Vector<double> &dst,
+ const Vector<double> &src);
+
/**
* Print a level vector using
* @ref{DoFHandler}.
#include <cmath>
-MGBase::~MGBase ()
+MGBase::~MGBase ()
{}
level_vmult(level, t, solution[level], defect[level]);
// make t rhs of lower level
-//TODO: this function adds the restricted t to defect[level-1].
-//TODO: why don't we have to clear it before?
+ // The non-refined parts of the
+ // coarse-level defect already contain
+ // the global defect.
transfer->restrict_and_add (level, defect[level-1], t);
+
+ // add additional DG contribution
+ edge_vmult(level, defect[level-1], defect[level]);
// do recursion
level_mgstep(level-1, pre_smooth, post_smooth, coarse_grid_solver);
}
+void
+MGBase::edge_vmult (const unsigned int,
+ Vector<double>&,
+ const Vector<double>&)
+{}
+
//////////////////////////////////////////////////////////////////////
MGCoarseGridSolver::~MGCoarseGridSolver()