From f618c5aeddbd8da205351b34bcb4896a746b0a83 Mon Sep 17 00:00:00 2001 From: Jonathan Youett <youett@math.fu-berlin.de> Date: Wed, 25 Mar 2015 18:22:19 +0100 Subject: [PATCH] Remove trailing whitespaces --- dune/solvers/iterationsteps/mmgstep.hh | 20 +++--- dune/solvers/iterationsteps/multigridstep.hh | 12 ++-- .../transferoperators/obstaclerestrictor.hh | 2 +- .../truncateddensemgtransfer.cc | 62 +++++++++---------- 4 files changed, 48 insertions(+), 48 deletions(-) diff --git a/dune/solvers/iterationsteps/mmgstep.hh b/dune/solvers/iterationsteps/mmgstep.hh index 55bb788b..f44e7b7d 100644 --- a/dune/solvers/iterationsteps/mmgstep.hh +++ b/dune/solvers/iterationsteps/mmgstep.hh @@ -15,16 +15,16 @@ template<class MatrixType, class VectorType> class MonotoneMGStep : public MultigridStep<MatrixType, VectorType> { - + static const int dim = VectorType::block_type::dimension; - + typedef typename VectorType::field_type field_type; typedef std::vector<BoxConstraint<field_type,dim> > ObstacleVectorType; public: - + MonotoneMGStep() : hasObstacleHierarchy_(0), obstacleHierarchy_(0) {} - + MonotoneMGStep(const MatrixType& mat, VectorType& x, VectorType& rhs) @@ -35,7 +35,7 @@ public: } virtual ~MonotoneMGStep() {} - + virtual void setProblem(const MatrixType& mat, VectorType& x, VectorType& rhs) @@ -45,19 +45,19 @@ public: } virtual void iterate(); - + virtual void preprocess(); - + virtual void nestedIteration(); - + ObstacleRestrictor<VectorType>* obstacleRestrictor_; - //! Bitfield determining which fine grid nodes have an obstacle + //! Bitfield determining which fine grid nodes have an obstacle Dune::BitSetVector<dim>* hasObstacle_; //! Vector containing the obstacle values of the fine grid nodes ObstacleVectorType * obstacles_; - + // Needed to track changes in the set of critical bits, and allows // to check which dofs where critical after the last iteration Dune::BitSetVector<dim> oldCritical; diff --git a/dune/solvers/iterationsteps/multigridstep.hh b/dune/solvers/iterationsteps/multigridstep.hh index 26a31bcd..73e67eac 100644 --- a/dune/solvers/iterationsteps/multigridstep.hh +++ b/dune/solvers/iterationsteps/multigridstep.hh @@ -32,8 +32,8 @@ preprocessCalled(false) {} - MultigridStep(const MatrixType& mat, - VectorType& x, + MultigridStep(const MatrixType& mat, + VectorType& x, VectorType& rhs, int mu, int nu1, int nu2, LinearIterationStep<MatrixType, VectorType>* preSmoother, @@ -54,8 +54,8 @@ this->ignoreNodes_ = ignoreNodes; } - MultigridStep(const MatrixType& mat, - VectorType& x, + MultigridStep(const MatrixType& mat, + VectorType& x, VectorType& rhs) : LinearIterationStep<MatrixType, VectorType>(mat, x, rhs), basesolver_(0), @@ -122,7 +122,7 @@ // virtual VectorType getSol(); // virtual const MatrixType* getMatrix(); - + /** \brief Return total number of levels of the multigrid hierarchy */ virtual size_t numLevels() const { @@ -131,7 +131,7 @@ virtual int level() const {return level_;} - /** \brief Sets the number of pre- and postsmoothing steps + /** \brief Sets the number of pre- and postsmoothing steps and of coarse corrections. \param mu Number of coarse corrections \param nu1 Number of presmoothing steps diff --git a/dune/solvers/transferoperators/obstaclerestrictor.hh b/dune/solvers/transferoperators/obstaclerestrictor.hh index 7d064780..975f4783 100644 --- a/dune/solvers/transferoperators/obstaclerestrictor.hh +++ b/dune/solvers/transferoperators/obstaclerestrictor.hh @@ -27,7 +27,7 @@ public: const Dune::BitSetVector<blocksize>& tHasObstacle, const MultigridTransfer<DiscFuncType>& transfer, const Dune::BitSetVector<blocksize>& critical) = 0; - + }; #endif diff --git a/dune/solvers/transferoperators/truncateddensemgtransfer.cc b/dune/solvers/transferoperators/truncateddensemgtransfer.cc index 6bbdd9e3..c7a0ad4d 100644 --- a/dune/solvers/transferoperators/truncateddensemgtransfer.cc +++ b/dune/solvers/transferoperators/truncateddensemgtransfer.cc @@ -28,9 +28,9 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::prolong(co typedef typename MatrixType::row_type RowType; typedef typename RowType::ConstIterator ColumnIterator; - + Iterator tIt = t.begin(); - ConstIterator fIt = f.begin(); + ConstIterator fIt = f.begin(); for(size_t rowIdx=0; rowIdx<this->matrix_.N(); rowIdx++) { @@ -56,7 +56,7 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::prolong(co } } - + ++tIt; } @@ -94,26 +94,26 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::restrict(c Iterator tIt = t.begin(); ConstIterator fIt = f.begin(); - + for (size_t rowIdx=0; rowIdx<this->matrix_.N(); rowIdx++) { - + const RowType& row = this->matrix_[rowIdx]; ColumnIterator cIt = row.begin(); ColumnIterator cEndIt = row.end(); - + for(; cIt!=cEndIt; ++cIt) { - + // The following lines are a matrix-vector loop, but rows belonging // to critical dofs are left out typename VectorType::block_type& tEntry = t[cIt.index()]; for (int i=0; i<blocksize; i++) { - + for (int j=0; j<blocksize; j++) { - + if (!critical[rowIdx][j]) tEntry[i] += (*cIt)[j][i] * f[rowIdx][j]; - + } } @@ -121,7 +121,7 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::restrict(c } } - + } @@ -154,13 +154,13 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const for (size_t i=0; i<coarseMat.N(); i++) { RowType& row = coarseMat[i]; - + // Loop over all columns of the stiffness matrix ColumnIterator m = row.begin(); ColumnIterator mEnd = row.end(); - + for (; m!=mEnd; ++m) { - + if ((*this->recompute_)[i].any() || (*this->recompute_)[m.index()].any()) *m = 0; @@ -172,13 +172,13 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const // Loop over all rows of the stiffness matrix for (size_t v=0; v<fineMat.N(); v++) { - + const RowType& row = fineMat[v]; // Loop over all columns of the stiffness matrix ConstColumnIterator m = row.begin(); ConstColumnIterator mEnd = row.end(); - + for (; m!=mEnd; ++m) { int w = m.index(); @@ -193,41 +193,41 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const // Loop over all coarse grid vectors jv that have w in their support ConstColumnIterator jm = this->matrix_[w].begin(); ConstColumnIterator jmEnd = this->matrix_[w].end(); - + for (; jm!=jmEnd; ++jm) { - + int jv = jm.index(); if (this->recompute_ && (*this->recompute_)[iv].none() && (*this->recompute_)[jv].none()) continue; - + typename MatrixType::block_type& cm = coarseMat[iv][jv]; - + // Compute im * m * jm, but omitting the critical entries for (int i=0; i<blocksize; i++) { - + for (int j=0; j<blocksize; j++) { - + double sum = 0.0; - + for (int k=0; k<blocksize; k++) { - + for (int l=0; l<blocksize; l++) { // Truncated Multigrid: Omit coupling if at least // one of the two vectors is critical if (this->critical_==nullptr || (!((*this->critical_)[v][k]) && !((*this->critical_)[w][l]))) { sum += (*im)[k][i] * (*m)[k][l] * (*jm)[l][j]; - - } - + + } + } - + } - + cm[i][j] += sum; - + } - + } } -- GitLab