Skip to content
Snippets Groups Projects
Commit f618c5ae authored by Jonathan Youett's avatar Jonathan Youett
Browse files

Remove trailing whitespaces

parent 66f798be
No related branches found
No related tags found
No related merge requests found
...@@ -15,16 +15,16 @@ ...@@ -15,16 +15,16 @@
template<class MatrixType, class VectorType> template<class MatrixType, class VectorType>
class MonotoneMGStep : public MultigridStep<MatrixType, VectorType> class MonotoneMGStep : public MultigridStep<MatrixType, VectorType>
{ {
static const int dim = VectorType::block_type::dimension; static const int dim = VectorType::block_type::dimension;
typedef typename VectorType::field_type field_type; typedef typename VectorType::field_type field_type;
typedef std::vector<BoxConstraint<field_type,dim> > ObstacleVectorType; typedef std::vector<BoxConstraint<field_type,dim> > ObstacleVectorType;
public: public:
MonotoneMGStep() : hasObstacleHierarchy_(0), obstacleHierarchy_(0) MonotoneMGStep() : hasObstacleHierarchy_(0), obstacleHierarchy_(0)
{} {}
MonotoneMGStep(const MatrixType& mat, MonotoneMGStep(const MatrixType& mat,
VectorType& x, VectorType& x,
VectorType& rhs) VectorType& rhs)
...@@ -35,7 +35,7 @@ public: ...@@ -35,7 +35,7 @@ public:
} }
virtual ~MonotoneMGStep() {} virtual ~MonotoneMGStep() {}
virtual void setProblem(const MatrixType& mat, virtual void setProblem(const MatrixType& mat,
VectorType& x, VectorType& x,
VectorType& rhs) VectorType& rhs)
...@@ -45,19 +45,19 @@ public: ...@@ -45,19 +45,19 @@ public:
} }
virtual void iterate(); virtual void iterate();
virtual void preprocess(); virtual void preprocess();
virtual void nestedIteration(); virtual void nestedIteration();
ObstacleRestrictor<VectorType>* obstacleRestrictor_; 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_; Dune::BitSetVector<dim>* hasObstacle_;
//! Vector containing the obstacle values of the fine grid nodes //! Vector containing the obstacle values of the fine grid nodes
ObstacleVectorType * obstacles_; ObstacleVectorType * obstacles_;
// Needed to track changes in the set of critical bits, and allows // Needed to track changes in the set of critical bits, and allows
// to check which dofs where critical after the last iteration // to check which dofs where critical after the last iteration
Dune::BitSetVector<dim> oldCritical; Dune::BitSetVector<dim> oldCritical;
......
...@@ -32,8 +32,8 @@ ...@@ -32,8 +32,8 @@
preprocessCalled(false) preprocessCalled(false)
{} {}
MultigridStep(const MatrixType& mat, MultigridStep(const MatrixType& mat,
VectorType& x, VectorType& x,
VectorType& rhs, VectorType& rhs,
int mu, int nu1, int nu2, int mu, int nu1, int nu2,
LinearIterationStep<MatrixType, VectorType>* preSmoother, LinearIterationStep<MatrixType, VectorType>* preSmoother,
...@@ -54,8 +54,8 @@ ...@@ -54,8 +54,8 @@
this->ignoreNodes_ = ignoreNodes; this->ignoreNodes_ = ignoreNodes;
} }
MultigridStep(const MatrixType& mat, MultigridStep(const MatrixType& mat,
VectorType& x, VectorType& x,
VectorType& rhs) : VectorType& rhs) :
LinearIterationStep<MatrixType, VectorType>(mat, x, rhs), LinearIterationStep<MatrixType, VectorType>(mat, x, rhs),
basesolver_(0), basesolver_(0),
...@@ -122,7 +122,7 @@ ...@@ -122,7 +122,7 @@
// virtual VectorType getSol(); // virtual VectorType getSol();
// virtual const MatrixType* getMatrix(); // virtual const MatrixType* getMatrix();
/** \brief Return total number of levels of the multigrid hierarchy */ /** \brief Return total number of levels of the multigrid hierarchy */
virtual size_t numLevels() const virtual size_t numLevels() const
{ {
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
virtual int level() const {return level_;} 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. and of coarse corrections.
\param mu Number of coarse corrections \param mu Number of coarse corrections
\param nu1 Number of presmoothing steps \param nu1 Number of presmoothing steps
......
...@@ -27,7 +27,7 @@ public: ...@@ -27,7 +27,7 @@ public:
const Dune::BitSetVector<blocksize>& tHasObstacle, const Dune::BitSetVector<blocksize>& tHasObstacle,
const MultigridTransfer<DiscFuncType>& transfer, const MultigridTransfer<DiscFuncType>& transfer,
const Dune::BitSetVector<blocksize>& critical) = 0; const Dune::BitSetVector<blocksize>& critical) = 0;
}; };
#endif #endif
...@@ -28,9 +28,9 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::prolong(co ...@@ -28,9 +28,9 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::prolong(co
typedef typename MatrixType::row_type RowType; typedef typename MatrixType::row_type RowType;
typedef typename RowType::ConstIterator ColumnIterator; typedef typename RowType::ConstIterator ColumnIterator;
Iterator tIt = t.begin(); Iterator tIt = t.begin();
ConstIterator fIt = f.begin(); ConstIterator fIt = f.begin();
for(size_t rowIdx=0; rowIdx<this->matrix_.N(); rowIdx++) { for(size_t rowIdx=0; rowIdx<this->matrix_.N(); rowIdx++) {
...@@ -56,7 +56,7 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::prolong(co ...@@ -56,7 +56,7 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::prolong(co
} }
} }
++tIt; ++tIt;
} }
...@@ -94,26 +94,26 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::restrict(c ...@@ -94,26 +94,26 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::restrict(c
Iterator tIt = t.begin(); Iterator tIt = t.begin();
ConstIterator fIt = f.begin(); ConstIterator fIt = f.begin();
for (size_t rowIdx=0; rowIdx<this->matrix_.N(); rowIdx++) { for (size_t rowIdx=0; rowIdx<this->matrix_.N(); rowIdx++) {
const RowType& row = this->matrix_[rowIdx]; const RowType& row = this->matrix_[rowIdx];
ColumnIterator cIt = row.begin(); ColumnIterator cIt = row.begin();
ColumnIterator cEndIt = row.end(); ColumnIterator cEndIt = row.end();
for(; cIt!=cEndIt; ++cIt) { for(; cIt!=cEndIt; ++cIt) {
// The following lines are a matrix-vector loop, but rows belonging // The following lines are a matrix-vector loop, but rows belonging
// to critical dofs are left out // to critical dofs are left out
typename VectorType::block_type& tEntry = t[cIt.index()]; typename VectorType::block_type& tEntry = t[cIt.index()];
for (int i=0; i<blocksize; i++) { for (int i=0; i<blocksize; i++) {
for (int j=0; j<blocksize; j++) { for (int j=0; j<blocksize; j++) {
if (!critical[rowIdx][j]) if (!critical[rowIdx][j])
tEntry[i] += (*cIt)[j][i] * f[rowIdx][j]; tEntry[i] += (*cIt)[j][i] * f[rowIdx][j];
} }
} }
...@@ -121,7 +121,7 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::restrict(c ...@@ -121,7 +121,7 @@ void TruncatedDenseMGTransfer<VectorType, BitVectorType, MatrixType>::restrict(c
} }
} }
} }
...@@ -154,13 +154,13 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const ...@@ -154,13 +154,13 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const
for (size_t i=0; i<coarseMat.N(); i++) { for (size_t i=0; i<coarseMat.N(); i++) {
RowType& row = coarseMat[i]; RowType& row = coarseMat[i];
// Loop over all columns of the stiffness matrix // Loop over all columns of the stiffness matrix
ColumnIterator m = row.begin(); ColumnIterator m = row.begin();
ColumnIterator mEnd = row.end(); ColumnIterator mEnd = row.end();
for (; m!=mEnd; ++m) { for (; m!=mEnd; ++m) {
if ((*this->recompute_)[i].any() || (*this->recompute_)[m.index()].any()) if ((*this->recompute_)[i].any() || (*this->recompute_)[m.index()].any())
*m = 0; *m = 0;
...@@ -172,13 +172,13 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const ...@@ -172,13 +172,13 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const
// Loop over all rows of the stiffness matrix // Loop over all rows of the stiffness matrix
for (size_t v=0; v<fineMat.N(); v++) { for (size_t v=0; v<fineMat.N(); v++) {
const RowType& row = fineMat[v]; const RowType& row = fineMat[v];
// Loop over all columns of the stiffness matrix // Loop over all columns of the stiffness matrix
ConstColumnIterator m = row.begin(); ConstColumnIterator m = row.begin();
ConstColumnIterator mEnd = row.end(); ConstColumnIterator mEnd = row.end();
for (; m!=mEnd; ++m) { for (; m!=mEnd; ++m) {
int w = m.index(); int w = m.index();
...@@ -193,41 +193,41 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const ...@@ -193,41 +193,41 @@ galerkinRestrict(const MatrixType& fineMat, MatrixType& coarseMat) const
// Loop over all coarse grid vectors jv that have w in their support // Loop over all coarse grid vectors jv that have w in their support
ConstColumnIterator jm = this->matrix_[w].begin(); ConstColumnIterator jm = this->matrix_[w].begin();
ConstColumnIterator jmEnd = this->matrix_[w].end(); ConstColumnIterator jmEnd = this->matrix_[w].end();
for (; jm!=jmEnd; ++jm) { for (; jm!=jmEnd; ++jm) {
int jv = jm.index(); int jv = jm.index();
if (this->recompute_ && (*this->recompute_)[iv].none() && (*this->recompute_)[jv].none()) if (this->recompute_ && (*this->recompute_)[iv].none() && (*this->recompute_)[jv].none())
continue; continue;
typename MatrixType::block_type& cm = coarseMat[iv][jv]; typename MatrixType::block_type& cm = coarseMat[iv][jv];
// Compute im * m * jm, but omitting the critical entries // Compute im * m * jm, but omitting the critical entries
for (int i=0; i<blocksize; i++) { for (int i=0; i<blocksize; i++) {
for (int j=0; j<blocksize; j++) { for (int j=0; j<blocksize; j++) {
double sum = 0.0; double sum = 0.0;
for (int k=0; k<blocksize; k++) { for (int k=0; k<blocksize; k++) {
for (int l=0; l<blocksize; l++) { for (int l=0; l<blocksize; l++) {
// Truncated Multigrid: Omit coupling if at least // Truncated Multigrid: Omit coupling if at least
// one of the two vectors is critical // one of the two vectors is critical
if (this->critical_==nullptr || (!((*this->critical_)[v][k]) && !((*this->critical_)[w][l]))) { if (this->critical_==nullptr || (!((*this->critical_)[v][k]) && !((*this->critical_)[w][l]))) {
sum += (*im)[k][i] * (*m)[k][l] * (*jm)[l][j]; sum += (*im)[k][i] * (*m)[k][l] * (*jm)[l][j];
} }
} }
} }
cm[i][j] += sum; cm[i][j] += sum;
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment