const bool transpose = false);
/**
- * Initialize for matrices. The
- * parameter @p matrices can be
- * any object having functions
- * <tt>get_minlevel()</tt> and
- * <tt>get_maxlevel()</tt> as well as
- * an <tt>operator[]</tt> returning a
- * reference to @p MATRIX. This
+ * Initialize for matrices. This
* function stores pointers to
* the level matrices and
* initializes the smoothing
- * operator for each level.
+ * operator with the same smoother
+ * for each level.
*
* @p additional_data is an
* object of type
* initialization function of the
* relaxation method.
*/
- template <class MGMATRIXOBJECT, class DATA>
- void initialize (const MGMATRIXOBJECT& matrices,
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
const DATA& additional_data);
+ /**
+ * Initialize for matrices. This
+ * function stores pointers to
+ * the level matrices and
+ * initializes the smoothing
+ * operator with the according
+ * smoother for each level.
+ *
+ * @p additional_data is an
+ * object of type
+ * @p RELAX::AdditionalData and
+ * is handed to the
+ * initialization function of the
+ * relaxation method.
+ */
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
+ const MGLevelObject<DATA>& additional_data);
+
/**
* Initialize for single blocks
- * of matrices. The parameter
- * @p matrices can be any object
- * having functions
- * <tt>get_minlevel()</tt> and
- * <tt>get_maxlevel()</tt> as well as
- * an <tt>operator[]</tt> returning a
- * reference to a block matrix
- * where each block is of type
- * @p MATRIX. Of this block
+ * of matrices. Of this block
* matrix, the block indicated by
* @p block_row and
* @p block_col is selected on
* each level. This function
* stores pointers to the level
* matrices and initializes the
- * smoothing operator for each
+ * smoothing operator with the
+ * same smoother for each
* level.
*
* @p additional_data is an
* initialization function of the
* relaxation method.
*/
- template <class MGMATRIXOBJECT, class DATA>
- void initialize (const MGMATRIXOBJECT& matrices,
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
const DATA& additional_data,
const unsigned int block_row,
+ const unsigned int block_col);
+
+ /**
+ * Initialize for single blocks
+ * of matrices. Of this block
+ * matrix, the block indicated by
+ * @p block_row and
+ * @p block_col is selected on
+ * each level. This function
+ * stores pointers to the level
+ * matrices and initializes the
+ * smoothing operator with the
+ * according smoother for each
+ * level.
+ *
+ * @p additional_data is an
+ * object of type
+ * @p RELAX::AdditionalData and
+ * is handed to the
+ * initialization function of the
+ * relaxation method.
+ */
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
+ const MGLevelObject<DATA>& additional_data,
+ const unsigned int block_row,
const unsigned int block_col);
/**
const bool transpose = false);
/**
- * Initialize for matrices. The
- * parameter @p matrices can be
- * any object having functions
- * <tt>get_minlevel()</tt> and
- * <tt>get_maxlevel()</tt> as well as
- * an <tt>operator[]</tt> returning a
- * reference to @p MATRIX. This
+ * Initialize for matrices. This
* function stores pointers to
* the level matrices and
* initializes the smoothing
- * operator for each level.
+ * operator with the same smoother
+ * for each level.
*
* @p additional_data is an
* object of type
* initialization function of the
* relaxation method.
*/
- template <class MGMATRIXOBJECT, class DATA>
- void initialize (const MGMATRIXOBJECT& matrices,
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
const DATA& additional_data);
+ /**
+ * Initialize for matrices. This
+ * function stores pointers to
+ * the level matrices and
+ * initializes the smoothing
+ * operator with the according
+ * smoother for each level.
+ *
+ * @p additional_data is an
+ * object of type
+ * @p RELAX::AdditionalData and
+ * is handed to the
+ * initialization function of the
+ * relaxation method.
+ */
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
+ const MGLevelObject<DATA>& additional_data);
+
/**
* Initialize for single blocks
- * of matrices. The parameter
- * @p matrices can be any object
- * having functions
- * <tt>get_minlevel()</tt> and
- * <tt>get_maxlevel()</tt> as well as
- * an <tt>operator[]</tt> returning a
- * reference to a block matrix
- * where each block is of type
- * @p MATRIX. Of this block
+ * of matrices. Of this block
* matrix, the block indicated by
* @p block_row and
* @p block_col is selected on
* each level. This function
* stores pointers to the level
* matrices and initializes the
- * smoothing operator for each
+ * smoothing operator with the
+ * same smoother for each
* level.
*
* @p additional_data is an
* initialization function of the
* relaxation method.
*/
- template <class MGMATRIXOBJECT, class DATA>
- void initialize (const MGMATRIXOBJECT& matrices,
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
const DATA& additional_data,
const unsigned int block_row,
+ const unsigned int block_col);
+
+ /**
+ * Initialize for single blocks
+ * of matrices. Of this block
+ * matrix, the block indicated by
+ * @p block_row and
+ * @p block_col is selected on
+ * each level. This function
+ * stores pointers to the level
+ * matrices and initializes the
+ * smoothing operator with the
+ * according smoother for each
+ * level.
+ *
+ * @p additional_data is an
+ * object of type
+ * @p RELAX::AdditionalData and
+ * is handed to the
+ * initialization function of the
+ * relaxation method.
+ */
+ template <class MATRIX2, class DATA>
+ void initialize (const MGLevelObject<MATRIX2>& matrices,
+ const MGLevelObject<DATA>& additional_data,
+ const unsigned int block_row,
const unsigned int block_col);
/**
template <class MATRIX, class RELAX, class VECTOR>
-template <class MGMATRIXOBJECT, class DATA>
+template <class MATRIX2, class DATA>
inline void
MGSmootherRelaxation<MATRIX, RELAX, VECTOR>::initialize (
- const MGMATRIXOBJECT& m,
+ const MGLevelObject<MATRIX2>& m,
const DATA& data)
{
const unsigned int min = m.get_minlevel();
}
}
+template <class MATRIX, class RELAX, class VECTOR>
+template <class MATRIX2, class DATA>
+inline void
+MGSmootherRelaxation<MATRIX, RELAX, VECTOR>::initialize (
+ const MGLevelObject<MATRIX2>& m,
+ const MGLevelObject<DATA>& data)
+{
+ const unsigned int min = m.get_minlevel();
+ const unsigned int max = m.get_maxlevel();
+
+ matrices.resize(min, max);
+ smoothers.resize(min, max);
+
+ for (unsigned int i=min;i<=max;++i)
+ {
+ matrices[i] = &m[i];
+ smoothers[i].initialize(m[i], data[i]);
+ }
+}
template <class MATRIX, class RELAX, class VECTOR>
-template <class MGMATRIXOBJECT, class DATA>
+template <class MATRIX2, class DATA>
inline void
MGSmootherRelaxation<MATRIX, RELAX, VECTOR>::initialize (
- const MGMATRIXOBJECT& m,
+ const MGLevelObject<MATRIX2>& m,
const DATA& data,
const unsigned int row,
const unsigned int col)
}
}
+template <class MATRIX, class RELAX, class VECTOR>
+template <class MATRIX2, class DATA>
+inline void
+MGSmootherRelaxation<MATRIX, RELAX, VECTOR>::initialize (
+ const MGLevelObject<MATRIX2>& m,
+ const MGLevelObject<DATA>& data,
+ const unsigned int row,
+ const unsigned int col)
+{
+ const unsigned int min = m.get_minlevel();
+ const unsigned int max = m.get_maxlevel();
+
+ matrices.resize(min, max);
+ smoothers.resize(min, max);
+
+ for (unsigned int i=min;i<=max;++i)
+ {
+ matrices[i] = &(m[i].block(row, col));
+ smoothers[i].initialize(m[i].block(row, col), data[i]);
+ }
+}
#ifdef DEAL_II_MULTIGRID_COMPATIBILITY
template <class MATRIX, class RELAX, class VECTOR>
-template <class MGMATRIXOBJECT, class DATA>
+template <class MATRIX2, class DATA>
inline void
MGSmootherPrecondition<MATRIX, RELAX, VECTOR>::initialize (
- const MGMATRIXOBJECT& m,
+ const MGLevelObject<MATRIX2>& m,
const DATA& data)
{
const unsigned int min = m.get_minlevel();
}
}
+template <class MATRIX, class RELAX, class VECTOR>
+template <class MATRIX2, class DATA>
+inline void
+MGSmootherPrecondition<MATRIX, RELAX, VECTOR>::initialize (
+ const MGLevelObject<MATRIX2>& m,
+ const MGLevelObject<DATA>& data)
+{
+ const unsigned int min = m.get_minlevel();
+ const unsigned int max = m.get_maxlevel();
+
+ matrices.resize(min, max);
+ smoothers.resize(min, max);
+
+ for (unsigned int i=min;i<=max;++i)
+ {
+ matrices[i] = &m[i];
+ smoothers[i].initialize(m[i], data[i]);
+ }
+}
template <class MATRIX, class RELAX, class VECTOR>
-template <class MGMATRIXOBJECT, class DATA>
+template <class MATRIX2, class DATA>
inline void
MGSmootherPrecondition<MATRIX, RELAX, VECTOR>::initialize (
- const MGMATRIXOBJECT& m,
+ const MGLevelObject<MATRIX2>& m,
const DATA& data,
const unsigned int row,
const unsigned int col)
}
}
+template <class MATRIX, class RELAX, class VECTOR>
+template <class MATRIX2, class DATA>
+inline void
+MGSmootherPrecondition<MATRIX, RELAX, VECTOR>::initialize (
+ const MGLevelObject<MATRIX2>& m,
+ const MGLevelObject<DATA>& data,
+ const unsigned int row,
+ const unsigned int col)
+{
+ const unsigned int min = m.get_minlevel();
+ const unsigned int max = m.get_maxlevel();
+
+ matrices.resize(min, max);
+ smoothers.resize(min, max);
+
+ for (unsigned int i=min;i<=max;++i)
+ {
+ matrices[i] = &(m[i].block(row, col));
+ smoothers[i].initialize(m[i].block(row, col), data[i]);
+ }
+}
template <class MATRIX, class RELAX, class VECTOR>
inline void