Skip to content
Snippets Groups Projects
Commit b443f0cb authored by Uli Sack's avatar Uli Sack Committed by usack
Browse files

deleted loads of white space

[[Imported from SVN: r5401]]
parent 337b5002
No related branches found
No related tags found
No related merge requests found
template<class DiscFuncType, class BitVectorType, class OperatorType>
void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::prolong(const DiscFuncType& f, DiscFuncType& t,
const BitVectorType& critical) const
......@@ -19,7 +17,7 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::p
typedef typename TransferOperatorType::row_type RowType;
typedef typename RowType::ConstIterator ColumnIterator;
Iterator tIt = t.begin();
ConstIterator fIt = f.begin();
......@@ -39,14 +37,10 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::p
if (!critical[rowIdx][i])
(*tIt)[i] += (*cIt)[0][0] * f[cIt.index()][i];
}
}
++tIt;
}
}
template<class DiscFuncType, class BitVectorType, class OperatorType>
......@@ -72,28 +66,24 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::r
typedef typename RowType::ConstIterator ColumnIterator;
for (int 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 DiscFuncType::block_type& tEntry = t[cIt.index()];
for (int i=0; i<blocksize; i++) {
if (!critical[rowIdx][i])
tEntry[i] += (*cIt)[0][0] * f[rowIdx][i];
}
}
}
}
......@@ -102,7 +92,6 @@ void TruncatedCompressedMGTransfer<DiscFuncType, BitVectorType, OperatorType>::
galerkinRestrict(const OperatorType& fineMat, OperatorType& coarseMat,
const BitVectorType& critical) const
{
if (this->recompute_ != NULL && this->recompute_->size() != (unsigned int)this->matrix_->M())
DUNE_THROW(Dune::Exception, "The size of the recompute_-bitfield doesn't match the "
<< "size of the coarse grid space!");
......@@ -123,31 +112,28 @@ galerkinRestrict(const OperatorType& fineMat, OperatorType& coarseMat,
for (int 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][0] || (*this->recompute_)[m.index()][0])
*m = 0;
}
}
}
// Loop over all rows of the stiffness matrix
for (int 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();
......@@ -162,33 +148,29 @@ galerkinRestrict(const OperatorType& fineMat, OperatorType& coarseMat,
// Loop over all coarse grid vectors jv that have w in their support
TransferConstColumnIterator jm = (*this->matrix_)[w].begin();
TransferConstColumnIterator jmEnd = (*this->matrix_)[w].end();
for (; jm!=jmEnd; ++jm) {
int jv = jm.index();
if (this->recompute_ && !((*this->recompute_)[iv][0]) && !((*this->recompute_)[jv][0]))
continue;
typename OperatorType::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++) {
// Truncated Multigrid: Omit coupling if at least
// one of the two vectors is critical
if (!critical[v][i] && !critical[w][j])
cm[i][j] += (*im)[0][0] * (*m)[i][j] * (*jm)[0][0];
}
}
}
}
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment