*
* @author Guido Kanschat, 2005
*/
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
class MGSmootherBlock
: public MGSmootherBase<BlockVector<number> >
{
* This function stores pointers to the level matrices and smoothing
* operator for each level.
*/
- template <class MGMatrixType, class MGRELAX>
- void initialize (const MGMatrixType &matrices,
- const MGRELAX &smoothers);
+ template <class MGMatrixType, class MGRelaxationType>
+ void initialize (const MGMatrixType &matrices,
+ const MGRelaxationType &smoothers);
/**
* Empty all vectors.
/**
* Pointer to the matrices.
*/
- MGLevelObject<PointerMatrix<RELAX, BlockVector<number> > > smoothers;
+ MGLevelObject<PointerMatrix<RelaxationType, BlockVector<number> > > smoothers;
/**
* Number of smoothing steps.
#ifndef DOXYGEN
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline
-MGSmootherBlock<MatrixType, RELAX, number>::MGSmootherBlock
+MGSmootherBlock<MatrixType, RelaxationType, number>::MGSmootherBlock
(VectorMemory<BlockVector<number> > &mem,
const unsigned int steps,
const bool variable,
{}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::clear ()
+MGSmootherBlock<MatrixType, RelaxationType, number>::clear ()
{
unsigned int i=matrices.min_level(),
max_level=matrices.max_level();
}
-template <typename MatrixType, class RELAX, typename number>
-template <class MGMatrixType, class MGRELAX>
+template <typename MatrixType, class RelaxationType, typename number>
+template <class MGMatrixType, class MGRelaxationType>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::initialize (const MGMatrixType &m,
- const MGRELAX &s)
+MGSmootherBlock<MatrixType, RelaxationType, number>::initialize (const MGMatrixType &m,
+ const MGRelaxationType &s)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::
+MGSmootherBlock<MatrixType, RelaxationType, number>::
set_steps (const unsigned int s)
{
steps = s;
}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::
+MGSmootherBlock<MatrixType, RelaxationType, number>::
set_variable (const bool flag)
{
variable = flag;
}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::
+MGSmootherBlock<MatrixType, RelaxationType, number>::
set_symmetric (const bool flag)
{
symmetric = flag;
}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::
+MGSmootherBlock<MatrixType, RelaxationType, number>::
set_transpose (const bool flag)
{
transpose = flag;
}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::
+MGSmootherBlock<MatrixType, RelaxationType, number>::
set_reverse (const bool flag)
{
reverse = flag;
}
-template <typename MatrixType, class RELAX, typename number>
+template <typename MatrixType, class RelaxationType, typename number>
inline void
-MGSmootherBlock<MatrixType, RELAX, number>::smooth(const unsigned int level,
- BlockVector<number> &u,
- const BlockVector<number> &rhs) const
+MGSmootherBlock<MatrixType, RelaxationType, number>::smooth(const unsigned int level,
+ BlockVector<number> &u,
+ const BlockVector<number> &rhs) const
{
deallog.push("Smooth");
* @author Guido Kanschat,
* @date 2003, 2009, 2010
*/
- template<class RELAX, typename VectorType>
- class SmootherRelaxation : public MGLevelObject<RELAX>, public MGSmoother<VectorType>
+ template<class RelaxationType, typename VectorType>
+ class SmootherRelaxation : public MGLevelObject<RelaxationType>, public MGSmoother<VectorType>
{
public:
/**
* Initialize for matrices. This function initializes the smoothing
* operator with the same smoother for each level.
*
- * @p additional_data is an object of type @p RELAX::AdditionalData and is
+ * @p additional_data is an object of type @p RelaxationType::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
template <typename MatrixType2>
void initialize (const MGLevelObject<MatrixType2> &matrices,
- const typename RELAX::AdditionalData &additional_data = typename RELAX::AdditionalData());
+ const typename RelaxationType::AdditionalData &additional_data
+ = typename RelaxationType::AdditionalData());
/**
* Initialize matrices and additional data for each level.
*
* @author Guido Kanschat, 2003
*/
-template<typename MatrixType, class RELAX, typename VectorType>
+template<typename MatrixType, class RelaxationType, typename VectorType>
class MGSmootherRelaxation : public MGSmoother<VectorType>
{
public:
* matrices and initializes the smoothing operator with the same 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.
+ * @p additional_data is an object of type @p RelaxationType::AdditionalData
+ * and is handed to the initialization function of the relaxation method.
*/
template <typename MatrixType2>
void initialize (const MGLevelObject<MatrixType2> &matrices,
- const typename RELAX::AdditionalData &additional_data = typename RELAX::AdditionalData());
+ const typename RelaxationType::AdditionalData &additional_data
+ = typename RelaxationType::AdditionalData());
/**
* 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
+ * @p additional_data is an object of type @p RelaxationType::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
template <typename MatrixType2, class DATA>
* This function stores pointers to the level matrices and initializes the
* smoothing operator with the same smoother for each level.
*
- * @p additional_data is an object of type @p RELAX::AdditionalData and is
+ * @p additional_data is an object of type @p RelaxationType::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
template <typename MatrixType2, class DATA>
* 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
+ * @p additional_data is an object of type @p RelaxationType::AdditionalData and is
* handed to the initialization function of the relaxation method.
*/
template <typename MatrixType2, class DATA>
/**
* Object containing relaxation methods.
*/
- MGLevelObject<RELAX> smoothers;
+ MGLevelObject<RelaxationType> smoothers;
/**
* Memory used by this object.
namespace mg
{
- template <class RELAX, typename VectorType>
+ template <class RelaxationType, typename VectorType>
inline
- SmootherRelaxation<RELAX, VectorType>::SmootherRelaxation
+ SmootherRelaxation<RelaxationType, VectorType>::SmootherRelaxation
(const unsigned int steps,
const bool variable,
const bool symmetric,
{}
- template <class RELAX, typename VectorType>
+ template <class RelaxationType, typename VectorType>
inline void
- SmootherRelaxation<RELAX, VectorType>::clear ()
+ SmootherRelaxation<RelaxationType, VectorType>::clear ()
{
- MGLevelObject<RELAX>::clear();
+ MGLevelObject<RelaxationType>::clear();
}
- template <class RELAX, typename VectorType>
+ template <class RelaxationType, typename VectorType>
template <typename MatrixType2>
inline void
- SmootherRelaxation<RELAX, VectorType>::initialize
+ SmootherRelaxation<RelaxationType, VectorType>::initialize
(const MGLevelObject<MatrixType2> &m,
- const typename RELAX::AdditionalData &data)
+ const typename RelaxationType::AdditionalData &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
- template <class RELAX, typename VectorType>
+ template <class RelaxationType, typename VectorType>
template <typename MatrixType2, class DATA>
inline void
- SmootherRelaxation<RELAX, VectorType>::initialize
+ SmootherRelaxation<RelaxationType, VectorType>::initialize
(const MGLevelObject<MatrixType2> &m,
const MGLevelObject<DATA> &data)
{
}
- template <class RELAX, typename VectorType>
+ template <class RelaxationType, typename VectorType>
inline void
- SmootherRelaxation<RELAX, VectorType>::smooth (const unsigned int level,
- VectorType &u,
- const VectorType &rhs) const
+ SmootherRelaxation<RelaxationType, VectorType>::smooth (const unsigned int level,
+ VectorType &u,
+ const VectorType &rhs) const
{
unsigned int maxlevel = this->max_level();
unsigned int steps2 = this->steps;
}
- template <class RELAX, typename VectorType>
+ template <class RelaxationType, typename VectorType>
inline
std::size_t
- SmootherRelaxation<RELAX, VectorType>::
+ SmootherRelaxation<RelaxationType, VectorType>::
memory_consumption () const
{
return sizeof(*this)
- -sizeof(MGLevelObject<RELAX>)
- + MGLevelObject<RELAX>::memory_consumption()
+ -sizeof(MGLevelObject<RelaxationType>)
+ + MGLevelObject<RelaxationType>::memory_consumption()
+ this->vector_memory.memory_consumption();
}
}
//----------------------------------------------------------------------//
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
inline
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::MGSmootherRelaxation
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::MGSmootherRelaxation
(const unsigned int steps,
const bool variable,
const bool symmetric,
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
inline void
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::clear ()
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::clear ()
{
smoothers.clear();
}
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
template <typename MatrixType2>
inline void
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::initialize
(const MGLevelObject<MatrixType2> &m,
- const typename RELAX::AdditionalData &data)
+ const typename RelaxationType::AdditionalData &data)
{
const unsigned int min = m.min_level();
const unsigned int max = m.max_level();
}
}
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
template <typename MatrixType2, class DATA>
inline void
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::initialize
(const MGLevelObject<MatrixType2> &m,
const MGLevelObject<DATA> &data)
{
}
}
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
template <typename MatrixType2, class DATA>
inline void
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::initialize
(const MGLevelObject<MatrixType2> &m,
const DATA &data,
const unsigned int row,
}
}
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
template <typename MatrixType2, class DATA>
inline void
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::initialize
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::initialize
(const MGLevelObject<MatrixType2> &m,
const MGLevelObject<DATA> &data,
const unsigned int row,
}
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
inline void
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::smooth (const unsigned int level,
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::smooth (const unsigned int level,
VectorType &u,
const VectorType &rhs) const
{
-template <typename MatrixType, class RELAX, typename VectorType>
+template <typename MatrixType, class RelaxationType, typename VectorType>
inline
std::size_t
-MGSmootherRelaxation<MatrixType, RELAX, VectorType>::
+MGSmootherRelaxation<MatrixType, RelaxationType, VectorType>::
memory_consumption () const
{
return sizeof(*this)