Skip to content
Snippets Groups Projects
Commit a1800633 authored by Markus Blatt's avatar Markus Blatt
Browse files

Removed bug in parallel amg code.

communication objects in smoothers were not valid.

[[Imported from SVN: r469]]
parent 3a879371
Branches
Tags
No related merge requests found
......@@ -208,12 +208,11 @@ namespace Dune
RIterator rhs = rhs_->finest();
DIterator lhs = lhs_->finest();
if(rhs!=rhs_->coarsest())
if(rhs!=rhs_->coarsest()) {
smoother->pre(*lhs,*rhs);
if(smoother != coarsest)
for(++smoother, ++lhs, ++rhs; smoother != coarsest; ++smoother, ++lhs, ++rhs)
smoother->pre(*lhs,*rhs);
}
if(buildHierarchy_) {
// Create the coarse Solver
......@@ -223,6 +222,7 @@ namespace Dune
typename ConstructionTraits<Smoother>::Arguments cargs;
cargs.setArgs(sargs);
cargs.setMatrix(matrices_->matrices().coarsest()->getmat());
cargs.setComm(*matrices_->parallelInformation().coarsest());
coarseSmoother_ = ConstructionTraits<Smoother>::construct(cargs);
scalarProduct_ = new OverlappingSchwarzScalarProduct<X,P>(*matrices_->parallelInformation().coarsest());
......
......@@ -522,7 +522,7 @@ namespace Dune
for(ConstIterator vertex=graph.begin(); vertex != end; ++vertex) {
const IndexPair* pair = lookup.pair(*vertex);
if(pair!=0 && pair->local().attribute()) {
if(pair!=0 && overlap.contains(pair->local().attribute())) {
overlapVertices[overlapCount].aggregate = aggregates[pair->local()];
overlapVertices[overlapCount].vertex = pair->local();
++overlapCount;
......
......@@ -626,13 +626,16 @@ namespace Dune
const typename SmootherTraits<S>::Arguments& sargs) const
{
assert(smoothers.levels()==0);
typedef typename ParallelMatrixHierarchy::ConstIterator Iterator;
typedef typename ParallelMatrixHierarchy::ConstIterator MatrixIterator;
typedef typename ParallelInformationHierarchy::ConstIterator PinfoIterator;
typename ConstructionTraits<S>::Arguments cargs;
cargs.setArgs(sargs);
Iterator coarsest = matrices_.coarsest();
PinfoIterator pinfo = parallelInformation_.finest();
for(Iterator matrix = matrices_.finest(); matrix != coarsest; ++matrix) {
for(MatrixIterator matrix = matrices_.finest(), coarsest = matrices_.coarsest();
matrix != coarsest; ++matrix, ++pinfo) {
cargs.setMatrix(matrix->getmat());
cargs.setComm(*pinfo);
smoothers.addCoarser(cargs);
}
}
......
......@@ -87,7 +87,7 @@ namespace Dune
}
void setComm(const C& comm)
{
comm_ = &comm_;
comm_ = &comm;
}
private:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment