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

Removed introduced segfault.

[[Imported from SVN: r3557]]
parent 91914a42
No related branches found
No related tags found
No related merge requests found
......@@ -34,7 +34,7 @@ namespace Dune
typedef Tuple<MatrixGraph*,PropertiesGraph*> GraphTuple;
template<class OF, class T>
static GraphTuple create(const M& matrix, T& excluded,
static GraphTuple create(const MatrixGraph& matrix, T& excluded,
const SequentialInformation& pinfo,
const OF&)
{
......@@ -43,6 +43,11 @@ namespace Dune
return GraphTuple(mg,pg);
}
static void free(GraphTuple& graphs)
{
delete Element<1>::get(graphs);
}
};
template<class M>
......@@ -79,6 +84,12 @@ namespace Dune
PropertiesGraph* pg = new PropertiesGraph(*sg, IdentityMap(), sg->getEdgeIndexMap());
return GraphTuple(mg,pg,sg);
}
static void free(GraphTuple& graphs)
{
delete Element<2>::get(graphs);
delete Element<1>::get(graphs);
}
};
} //namespace Amg
......
......@@ -515,6 +515,8 @@ namespace Dune
*aggregatesMap,
*coarseInfo);
GraphCreator::free(graphs);
parallelInformation_.addCoarser(*coarseInfo);
PInfoIterator fineInfo = infoLevel;
......@@ -548,6 +550,8 @@ namespace Dune
*aggregatesMap,
aggregates,
OverlapFlags());
delete Element<0>::get(graphs);
productBuilder.calculate(mlevel->getmat(), *aggregatesMap, *coarseMatrix);
dinfo<<"Calculation of Galerkin product took "<<watch.elapsed()<<" seconds."<<std::endl;
......@@ -584,13 +588,16 @@ namespace Dune
typedef typename ParallelInformationHierarchy::Iterator InfoIterator;
AggregatesMapIterator amap = aggregatesMaps_.rbegin();
InfoIterator info = parallelInformation_.finest();
InfoIterator info = parallelInformation_.coarsest();
int i=0;
for(Iterator level=matrices_.coarsest(), finest=matrices_.finest(); level != finest; --level, --info, ++amap) {
std::cout<<"Freeing level "<<i++<<std::endl;
(*amap)->free();
delete *amap;
delete &level->getmat();
delete &(*info);
}
delete *amap;
delete &(*info);
}
template<class M, class IS, class A>
......
......@@ -227,9 +227,6 @@ namespace Dune
coarseIndices.endResize();
assert(coarseIndices.size()==renumberer);
assert((coarseIndices.begin()+(coarseIndices.size()-1))->local()==renumberer-1);
// Reset the visited flags
typedef typename Graph::ConstVertexIterator VertexIterator;
VertexIterator vend = fineGraph.end();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment