From bb5e18e603de823e03ec79d4dd88c10def2427ac Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 9 Dec 2015 10:06:54 -0500 Subject: [PATCH] Prefer RelaxationType to RELAX or RELAXATION. --- include/deal.II/lac/solver_relaxation.h | 20 ++-- include/deal.II/multigrid/mg_block_smoother.h | 54 +++++------ include/deal.II/multigrid/mg_smoother.h | 96 ++++++++++--------- 3 files changed, 86 insertions(+), 84 deletions(-) diff --git a/include/deal.II/lac/solver_relaxation.h b/include/deal.II/lac/solver_relaxation.h index 1c67e3080e..fad56a269b 100644 --- a/include/deal.II/lac/solver_relaxation.h +++ b/include/deal.II/lac/solver_relaxation.h @@ -79,12 +79,12 @@ public: * R(x_k,b)$. The matrix A itself is only used to compute the * residual. */ - template + template void - solve (const MatrixType &A, - VectorType &x, - const VectorType &b, - const RELAXATION &R); + solve (const MatrixType &A, + VectorType &x, + const VectorType &b, + const RelaxationType &R); }; //----------------------------------------------------------------------// @@ -104,12 +104,12 @@ SolverRelaxation::~SolverRelaxation() template -template +template void -SolverRelaxation::solve (const MatrixType &A, - VectorType &x, - const VectorType &b, - const RELAXATION &R) +SolverRelaxation::solve (const MatrixType &A, + VectorType &x, + const VectorType &b, + const RelaxationType &R) { GrowingVectorMemory mem; SolverControl::State conv=SolverControl::iterate; diff --git a/include/deal.II/multigrid/mg_block_smoother.h b/include/deal.II/multigrid/mg_block_smoother.h index 53ae1fe224..1408e90a94 100644 --- a/include/deal.II/multigrid/mg_block_smoother.h +++ b/include/deal.II/multigrid/mg_block_smoother.h @@ -43,7 +43,7 @@ DEAL_II_NAMESPACE_OPEN * * @author Guido Kanschat, 2005 */ -template +template class MGSmootherBlock : public MGSmootherBase > { @@ -71,9 +71,9 @@ public: * This function stores pointers to the level matrices and smoothing * operator for each level. */ - template - void initialize (const MGMatrixType &matrices, - const MGRELAX &smoothers); + template + void initialize (const MGMatrixType &matrices, + const MGRelaxationType &smoothers); /** * Empty all vectors. @@ -122,7 +122,7 @@ private: /** * Pointer to the matrices. */ - MGLevelObject > > smoothers; + MGLevelObject > > smoothers; /** * Number of smoothing steps. @@ -162,9 +162,9 @@ private: #ifndef DOXYGEN -template +template inline -MGSmootherBlock::MGSmootherBlock +MGSmootherBlock::MGSmootherBlock (VectorMemory > &mem, const unsigned int steps, const bool variable, @@ -181,9 +181,9 @@ MGSmootherBlock::MGSmootherBlock {} -template +template inline void -MGSmootherBlock::clear () +MGSmootherBlock::clear () { unsigned int i=matrices.min_level(), max_level=matrices.max_level(); @@ -195,11 +195,11 @@ MGSmootherBlock::clear () } -template -template +template +template inline void -MGSmootherBlock::initialize (const MGMatrixType &m, - const MGRELAX &s) +MGSmootherBlock::initialize (const MGMatrixType &m, + const MGRelaxationType &s) { const unsigned int min = m.min_level(); const unsigned int max = m.max_level(); @@ -214,56 +214,56 @@ MGSmootherBlock::initialize (const MGMatrixType &m, } } -template +template inline void -MGSmootherBlock:: +MGSmootherBlock:: set_steps (const unsigned int s) { steps = s; } -template +template inline void -MGSmootherBlock:: +MGSmootherBlock:: set_variable (const bool flag) { variable = flag; } -template +template inline void -MGSmootherBlock:: +MGSmootherBlock:: set_symmetric (const bool flag) { symmetric = flag; } -template +template inline void -MGSmootherBlock:: +MGSmootherBlock:: set_transpose (const bool flag) { transpose = flag; } -template +template inline void -MGSmootherBlock:: +MGSmootherBlock:: set_reverse (const bool flag) { reverse = flag; } -template +template inline void -MGSmootherBlock::smooth(const unsigned int level, - BlockVector &u, - const BlockVector &rhs) const +MGSmootherBlock::smooth(const unsigned int level, + BlockVector &u, + const BlockVector &rhs) const { deallog.push("Smooth"); diff --git a/include/deal.II/multigrid/mg_smoother.h b/include/deal.II/multigrid/mg_smoother.h index 3dded6693c..2906a57b38 100644 --- a/include/deal.II/multigrid/mg_smoother.h +++ b/include/deal.II/multigrid/mg_smoother.h @@ -180,8 +180,8 @@ namespace mg * @author Guido Kanschat, * @date 2003, 2009, 2010 */ - template - class SmootherRelaxation : public MGLevelObject, public MGSmoother + template + class SmootherRelaxation : public MGLevelObject, public MGSmoother { public: /** @@ -196,12 +196,13 @@ namespace mg * 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 void initialize (const MGLevelObject &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. @@ -270,7 +271,7 @@ namespace mg * * @author Guido Kanschat, 2003 */ -template +template class MGSmootherRelaxation : public MGSmoother { public: @@ -287,19 +288,20 @@ 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 void initialize (const MGLevelObject &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 @@ -312,7 +314,7 @@ public: * 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 @@ -327,7 +329,7 @@ public: * 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 @@ -351,7 +353,7 @@ public: /** * Object containing relaxation methods. */ - MGLevelObject smoothers; + MGLevelObject smoothers; /** * Memory used by this object. @@ -574,9 +576,9 @@ MGSmoother::set_transpose (const bool flag) namespace mg { - template + template inline - SmootherRelaxation::SmootherRelaxation + SmootherRelaxation::SmootherRelaxation (const unsigned int steps, const bool variable, const bool symmetric, @@ -585,20 +587,20 @@ namespace mg {} - template + template inline void - SmootherRelaxation::clear () + SmootherRelaxation::clear () { - MGLevelObject::clear(); + MGLevelObject::clear(); } - template + template template inline void - SmootherRelaxation::initialize + SmootherRelaxation::initialize (const MGLevelObject &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(); @@ -610,10 +612,10 @@ namespace mg } - template + template template inline void - SmootherRelaxation::initialize + SmootherRelaxation::initialize (const MGLevelObject &m, const MGLevelObject &data) { @@ -627,11 +629,11 @@ namespace mg } - template + template inline void - SmootherRelaxation::smooth (const unsigned int level, - VectorType &u, - const VectorType &rhs) const + SmootherRelaxation::smooth (const unsigned int level, + VectorType &u, + const VectorType &rhs) const { unsigned int maxlevel = this->max_level(); unsigned int steps2 = this->steps; @@ -657,15 +659,15 @@ namespace mg } - template + template inline std::size_t - SmootherRelaxation:: + SmootherRelaxation:: memory_consumption () const { return sizeof(*this) - -sizeof(MGLevelObject) - + MGLevelObject::memory_consumption() + -sizeof(MGLevelObject) + + MGLevelObject::memory_consumption() + this->vector_memory.memory_consumption(); } } @@ -673,9 +675,9 @@ namespace mg //----------------------------------------------------------------------// -template +template inline -MGSmootherRelaxation::MGSmootherRelaxation +MGSmootherRelaxation::MGSmootherRelaxation (const unsigned int steps, const bool variable, const bool symmetric, @@ -686,9 +688,9 @@ MGSmootherRelaxation::MGSmootherRelaxation -template +template inline void -MGSmootherRelaxation::clear () +MGSmootherRelaxation::clear () { smoothers.clear(); @@ -699,12 +701,12 @@ MGSmootherRelaxation::clear () } -template +template template inline void -MGSmootherRelaxation::initialize +MGSmootherRelaxation::initialize (const MGLevelObject &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(); @@ -719,10 +721,10 @@ MGSmootherRelaxation::initialize } } -template +template template inline void -MGSmootherRelaxation::initialize +MGSmootherRelaxation::initialize (const MGLevelObject &m, const MGLevelObject &data) { @@ -744,10 +746,10 @@ MGSmootherRelaxation::initialize } } -template +template template inline void -MGSmootherRelaxation::initialize +MGSmootherRelaxation::initialize (const MGLevelObject &m, const DATA &data, const unsigned int row, @@ -766,10 +768,10 @@ MGSmootherRelaxation::initialize } } -template +template template inline void -MGSmootherRelaxation::initialize +MGSmootherRelaxation::initialize (const MGLevelObject &m, const MGLevelObject &data, const unsigned int row, @@ -794,9 +796,9 @@ MGSmootherRelaxation::initialize } -template +template inline void -MGSmootherRelaxation::smooth (const unsigned int level, +MGSmootherRelaxation::smooth (const unsigned int level, VectorType &u, const VectorType &rhs) const { @@ -825,10 +827,10 @@ MGSmootherRelaxation::smooth (const unsigned int -template +template inline std::size_t -MGSmootherRelaxation:: +MGSmootherRelaxation:: memory_consumption () const { return sizeof(*this) -- 2.39.5