3#ifndef DUNE_AMG_GRAPHCREATOR_HH
4#define DUNE_AMG_GRAPHCREATOR_HH
18 template<
class M,
class PI>
19 struct PropertiesGraphCreator
21 typedef typename M::matrix_type Matrix;
24 std::vector<bool> > SubGraph;
29 typename SubGraph::EdgeIndexMap>
32 typedef std::tuple<MatrixGraph*,PropertiesGraph*,SubGraph*> GraphTuple;
34 template<
class OF,
class T>
35 static GraphTuple create(
const M& matrix, T& excluded,
36 PI& pinfo,
const OF& of)
38 MatrixGraph* mg =
new MatrixGraph(matrix.getmat());
39 typedef typename PI::ParallelIndexSet ParallelIndexSet;
41 IndexIterator iend = pinfo.indexSet().end();
43 for(IndexIterator index = pinfo.indexSet().begin(); index != iend; ++index)
44 excluded[index->local()] = of.contains(index->local().attribute());
46 SubGraph* sg=
new SubGraph(*mg, excluded);
47 PropertiesGraph* pg =
new PropertiesGraph(*sg, IdentityMap(), sg->getEdgeIndexMap());
48 return GraphTuple(mg,pg,sg);
51 static void free(GraphTuple& graphs)
53 delete std::get<2>(graphs);
54 delete std::get<1>(graphs);
59 struct PropertiesGraphCreator<M,SequentialInformation>
61 typedef typename M::matrix_type Matrix;
69 IdentityMap> PropertiesGraph;
71 typedef std::tuple<MatrixGraph*,PropertiesGraph*> GraphTuple;
73 template<
class OF,
class T>
74 static GraphTuple create([[maybe_unused]]
const M& matrix,
75 [[maybe_unused]] T& excluded,
76 [[maybe_unused]]
const SequentialInformation& pinfo,
79 MatrixGraph* mg =
new MatrixGraph(matrix.getmat());
80 PropertiesGraph* pg =
new PropertiesGraph(*mg, IdentityMap(), IdentityMap());
81 return GraphTuple(mg,pg);
84 static void free(GraphTuple& graphs)
86 delete std::get<1>(graphs);
Implementation of the BCRSMatrix class.
The (undirected) graph of a matrix.
Definition: graph.hh:49
Attaches properties to the edges and vertices of a graph.
Definition: graph.hh:976
A subgraph of a graph.
Definition: graph.hh:441
Provides classes for initializing the link attributes of a matrix graph.
Provides classes for building the matrix graph.
ArrayList< IndexPair, N >::const_iterator const_iterator
The constant iterator over the pairs.
Definition: indexset.hh:296
Dune namespace.
Definition: alignedallocator.hh:11
Define general, extensible interface for operators. The available implementation wraps a matrix.