// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
* require several helper classes handed over as template parameters.
* These classes have to meet the following requirements:
*
- * @p{MATRIX} is a matrix as specified for LAC-solvers, that is, it
+ * <tt>MATRIX</tt> is a matrix as specified for LAC-solvers, that is, it
* has a function
- * \begin{verbatim}
+ * @code
* void MATRIX::vmult(VECTOR& x, const VECTOR& b)
- * \end{verbatim}
- * performing the matrix vector product @p{x=Ab}.
+ * @endcode
+ * performing the matrix vector product <i>x=Ab</i>.
*
- * @p{SMOOTH} is a class with a function
- * \begin{verbatim}
+ * <tt>SMOOTH</tt> is a class with a function
+ * @code
* void SMOOTH::smooth (unsigned int level, VECTOR& x, const VECTOR& b)
- * \end{verbatim}
- * modifying the vector @p{x} such that the residual @{b-Ax}
- * on level @p{l} is smoothened. Refer to @ref{MGSmootherRelaxation}
+ * @endcode
+ * modifying the vector <i>x</i> such that the residual <i>b-Ax</i>
+ * on level <i>l</i> is smoothened. Refer to MGSmootherRelaxation
* for an example.
*
- * @p{COARSE} has an
- * \begin{verbatim}
+ * <tt>COARSE</tt> has an
+ * @code
* void COARSE::operator() (VECTOR& x, const VECTOR& b)
- * \end{verbatim}
+ * @endcode
* returning the solution to the system @p{Ax=b} on the coarsest level
- * in @p{x}.
+ * in <i>x</i>.
*
- * @author Guido Kanschat, 1999, 2001, 2002, Ralf Hartmann 2002, 2003.
+ * @author Guido Kanschat, 1999 - 2004
*/
template <class VECTOR>
class Multigrid : public Subscriptor
void set_edge_matrices (const MGMatrixBase<VECTOR>& edge_down,
const MGMatrixBase<VECTOR>& edge_up);
-#ifdef MG_DEBUG
- void print_vector (const unsigned int level,
- const VECTOR &v,
- const char *name) const;
-#endif
-
private:
/**
*/
SmartPointer<const MGMatrixBase<VECTOR> > edge_up;
- /**
- * Pointer to the MGDoFHandler
- * given to the constructor. Only
- * needed for @p{MG_DEBUG}
- * defined.
- */
-//TODO[GK]: This won't fly: deal_II_dimension can't be used in header files
-#ifdef MG_DEBUG
- SmartPointer<const MGDoFHandler<deal_II_dimension> > mg_dof_handler;
-#endif
/**
* Exception.
*/
post_smooth(&post_smooth),
edge_down(0),
edge_up(0)
-#ifdef MG_DEBUG
- , mg_dof_handler(&mg_dof_handler)
-#endif
{}
// $Id$
// Version: $Name$
//
-// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 by the deal.II authors
+// Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003, 2004 by the deal.II authors
//
// This file is subject to QPL and may not be distributed
// without copyright and license information. Please refer
#define __deal2__multigrid_templates_h
#include <multigrid/multigrid.h>
-#ifdef MG_DEBUG
-# include <fe/fe.h>
-# include <dofs/dof_accessor.h>
-# include <numerics/data_out.h>
-# include <multigrid/mg_dof_accessor.h>
-# include <multigrid/mg_dof_handler.h>
-
-# include <fstream>
-#endif
-
-
-
template <class VECTOR>
void
void
Multigrid<VECTOR>::level_mgstep(const unsigned int level)
{
-#ifdef MG_DEBUG
- char *name = new char[100];
- sprintf(name, "MG%d-defect",level);
- print_vector(level, defect[level], name);
-#endif
-
solution[level] = 0.;
if (level == minlevel)
{
(*coarse)(level, solution[level], defect[level]);
-#ifdef MG_DEBUG
- sprintf(name, "MG%d-solution",level);
- print_vector(level, solution[level], name);
-#endif
return;
}
// modifying s
pre_smooth->smooth(level, solution[level], defect[level]);
-#ifdef MG_DEBUG
- sprintf(name, "MG%d-pre",level);
- print_vector(level, solution[level], name);
-#endif
-
// t = A*solution[level]
matrix->vmult(level, t[level], solution[level]);
// do coarse grid correction
transfer->prolongate(level, t[level], solution[level-1]);
-
-#ifdef MG_DEBUG
- sprintf(name, "MG%d-cgc",level);
- print_vector(level, t[level], name);
-#endif
-
+
solution[level] += t[level];
if (edge_up != 0)
// post-smoothing
post_smooth->smooth(level, solution[level], defect[level]);
-
-#ifdef MG_DEBUG
- sprintf(name, "MG%d-post",level);
- print_vector(level, solution[level], name);
-
- delete[] name;
-#endif
}