Skip to content
Snippets Groups Projects
Commit 85e7f959 authored by Rebecca Neumann's avatar Rebecca Neumann
Browse files

add missing graphproperties for novlp AMG

[[Imported from SVN: r1328]]
parent c98c85d6
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,47 @@ namespace Dune
}
};
template<class M>
struct PropertiesGraphCreator<M,SolverCategory::nonoverlapping>
{
typedef typename M::matrix_type Matrix;
typedef Dune::Amg::MatrixGraph<const Matrix> MatrixGraph;
typedef Dune::Amg::SubGraph<MatrixGraph,
std::vector<bool> > SubGraph;
typedef Dune::Amg::PropertiesGraph<SubGraph,
VertexProperties,
EdgeProperties,
IdentityMap,
typename SubGraph::EdgeIndexMap>
PropertiesGraph;
typedef Dune::tuple<MatrixGraph*,PropertiesGraph*,SubGraph*> GraphTuple;
template<class OF, class T, class PI>
static GraphTuple create(const M& matrix, T& excluded,
PI& pinfo, const OF& of)
{
typedef OF OverlapFlags;
MatrixGraph* mg = new MatrixGraph(matrix.getmat());
typedef typename PI::ParallelIndexSet ParallelIndexSet;
typedef typename ParallelIndexSet::const_iterator IndexIterator;
IndexIterator iend = pinfo.indexSet().end();
for(IndexIterator index = pinfo.indexSet().begin(); index != iend; ++index)
excluded[index->local()] = of.contains(index->local().attribute());
SubGraph* sg= new SubGraph(*mg, excluded);
PropertiesGraph* pg = new PropertiesGraph(*sg, IdentityMap(), sg->getEdgeIndexMap());
return GraphTuple(mg,pg,sg);
}
static void free(GraphTuple& graphs)
{
delete get<2>(graphs);
delete get<1>(graphs);
}
};
} //namespace Amg
} // namespace Dune
#endif
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