3 #ifndef DUNE_AMG_GRAPHCREATOR_HH
4 #define DUNE_AMG_GRAPHCREATOR_HH
11 #include <dune/common/tuples.hh>
12 #include <dune/common/unused.hh>
18 template<
class M,
int cat=M::category>
25 typedef typename M::matrix_type
Matrix;
35 typedef Dune::tuple<MatrixGraph*,PropertiesGraph*>
GraphTuple;
37 template<
class OF,
class T>
38 static GraphTuple
create(
const M& matrix, T& excluded,
42 DUNE_UNUSED_PARAMETER(excluded);
43 DUNE_UNUSED_PARAMETER(pinfo);
44 MatrixGraph* mg =
new MatrixGraph(matrix.getmat());
45 PropertiesGraph* pg =
new PropertiesGraph(*mg, IdentityMap(), IdentityMap());
46 return GraphTuple(mg,pg);
49 static void free(GraphTuple& graphs)
51 delete get<1>(graphs);
59 typedef typename M::matrix_type
Matrix;
70 typedef Dune::tuple<MatrixGraph*,PropertiesGraph*,SubGraph*>
GraphTuple;
72 template<
class OF,
class T,
class PI>
73 static GraphTuple
create(
const M& matrix, T& excluded,
74 PI& pinfo,
const OF& of)
76 MatrixGraph* mg =
new MatrixGraph(matrix.getmat());
77 typedef typename PI::ParallelIndexSet ParallelIndexSet;
78 typedef typename ParallelIndexSet::const_iterator IndexIterator;
79 IndexIterator iend = pinfo.indexSet().end();
81 for(IndexIterator index = pinfo.indexSet().begin(); index != iend; ++index)
82 excluded[index->local()] = of.contains(index->local().attribute());
84 SubGraph* sg=
new SubGraph(*mg, excluded);
86 return GraphTuple(mg,pg,sg);
89 static void free(GraphTuple& graphs)
91 delete get<2>(graphs);
92 delete get<1>(graphs);
99 typedef typename M::matrix_type
Matrix;
110 typedef Dune::tuple<MatrixGraph*,PropertiesGraph*,SubGraph*>
GraphTuple;
112 template<
class OF,
class T,
class PI>
113 static GraphTuple
create(
const M& matrix, T& excluded,
114 PI& pinfo,
const OF& of)
116 MatrixGraph* mg =
new MatrixGraph(matrix.getmat());
117 typedef typename PI::ParallelIndexSet ParallelIndexSet;
118 typedef typename ParallelIndexSet::const_iterator IndexIterator;
119 IndexIterator iend = pinfo.indexSet().end();
121 for(IndexIterator index = pinfo.indexSet().begin(); index != iend; ++index)
122 excluded[index->local()] = of.contains(index->local().attribute());
124 SubGraph* sg=
new SubGraph(*mg, excluded);
126 return GraphTuple(mg,pg,sg);
129 static void free(GraphTuple& graphs)
131 delete get<2>(graphs);
132 delete get<1>(graphs);
Dune::Amg::MatrixGraph< const Matrix > MatrixGraph
Definition: graphcreator.hh:27
Implementation of the BCRSMatrix class.
Definition: basearray.hh:19
static GraphTuple create(const M &matrix, T &excluded, PI &pinfo, const OF &of)
Definition: graphcreator.hh:73
Attaches properties to the edges and vertices of a graph.
Definition: graph.hh:975
static void free(GraphTuple &graphs)
Definition: graphcreator.hh:89
Class representing a node in the matrix graph.
Definition: dependency.hh:125
Dune::Amg::PropertiesGraph< MatrixGraph, VertexProperties, EdgeProperties, IdentityMap, IdentityMap > PropertiesGraph
Definition: graphcreator.hh:33
Dune::Amg::MatrixGraph< const Matrix > MatrixGraph
Definition: graphcreator.hh:100
The (undirected) graph of a matrix.
Definition: graph.hh:48
Class representing the properties of an ede in the matrix graph.
Definition: dependency.hh:37
Categories for the solvers.
Definition: solvercategory.hh:17
M::matrix_type Matrix
Definition: graphcreator.hh:59
Dune::tuple< MatrixGraph *, PropertiesGraph *, SubGraph * > GraphTuple
Definition: graphcreator.hh:110
Dune::Amg::PropertiesGraph< SubGraph, VertexProperties, EdgeProperties, IdentityMap, typename SubGraph::EdgeIndexMap > PropertiesGraph
Definition: graphcreator.hh:68
Provides classes for initializing the link attributes of a matrix graph.
Define general, extensible interface for operators. The available implementation wraps a matrix...
An index map for mapping the edges to indices.
Definition: graph.hh:467
M::matrix_type Matrix
Definition: graphcreator.hh:99
Dune::tuple< MatrixGraph *, PropertiesGraph * > GraphTuple
Definition: graphcreator.hh:35
static GraphTuple create(const M &matrix, T &excluded, const SequentialInformation &pinfo, const OF &)
Definition: graphcreator.hh:38
static void free(GraphTuple &graphs)
Definition: graphcreator.hh:129
static GraphTuple create(const M &matrix, T &excluded, PI &pinfo, const OF &of)
Definition: graphcreator.hh:113
static void free(GraphTuple &graphs)
Definition: graphcreator.hh:49
M::matrix_type Matrix
Definition: graphcreator.hh:25
A subgraph of a graph.
Definition: graph.hh:440
Provides classes for building the matrix graph.
Dune::tuple< MatrixGraph *, PropertiesGraph *, SubGraph * > GraphTuple
Definition: graphcreator.hh:70
Dune::Amg::SubGraph< MatrixGraph, std::vector< bool > > SubGraph
Definition: graphcreator.hh:62
Dune::Amg::MatrixGraph< const Matrix > MatrixGraph
Definition: graphcreator.hh:60
EdgeIndexMap getEdgeIndexMap()
Get an edge index map for the graph.
Dune::Amg::PropertiesGraph< SubGraph, VertexProperties, EdgeProperties, IdentityMap, typename SubGraph::EdgeIndexMap > PropertiesGraph
Definition: graphcreator.hh:108
Definition: graphcreator.hh:19
Dune::Amg::SubGraph< MatrixGraph, std::vector< bool > > SubGraph
Definition: graphcreator.hh:102