3 #ifndef DUNE_AMG_GRAPHCREATOR_HH 4 #define DUNE_AMG_GRAPHCREATOR_HH 13 #include <dune/common/unused.hh> 19 template<
class M,
class PI>
22 typedef typename M::matrix_type
Matrix;
33 typedef std::tuple<MatrixGraph*,PropertiesGraph*,SubGraph*>
GraphTuple;
35 template<
class OF,
class T>
36 static GraphTuple
create(
const M& matrix, T& excluded,
37 PI& pinfo,
const OF& of)
40 typedef typename PI::ParallelIndexSet ParallelIndexSet;
41 typedef typename ParallelIndexSet::const_iterator IndexIterator;
42 IndexIterator iend = pinfo.indexSet().end();
44 for(IndexIterator index = pinfo.indexSet().begin(); index != iend; ++index)
45 excluded[index->local()] = of.contains(index->local().attribute());
47 SubGraph* sg=
new SubGraph(*mg, excluded);
52 static void free(GraphTuple& graphs)
54 delete std::get<2>(graphs);
55 delete std::get<1>(graphs);
62 typedef typename M::matrix_type
Matrix;
72 typedef std::tuple<MatrixGraph*,PropertiesGraph*>
GraphTuple;
74 template<
class OF,
class T>
75 static GraphTuple
create(
const M& matrix, T& excluded,
79 DUNE_UNUSED_PARAMETER(excluded);
80 DUNE_UNUSED_PARAMETER(pinfo);
82 PropertiesGraph* pg =
new PropertiesGraph(*mg, IdentityMap(), IdentityMap());
86 static void free(GraphTuple& graphs)
88 delete std::get<1>(graphs);
static GraphTuple create(const M &matrix, T &excluded, const SequentialInformation &pinfo, const OF &)
Definition: graphcreator.hh:75
M::matrix_type Matrix
Definition: graphcreator.hh:62
Definition: allocator.hh:7
Dune::Amg::MatrixGraph< const Matrix > MatrixGraph
Definition: graphcreator.hh:64
std::tuple< MatrixGraph *, PropertiesGraph *, SubGraph * > GraphTuple
Definition: graphcreator.hh:33
Dune::Amg::PropertiesGraph< SubGraph, VertexProperties, EdgeProperties, IdentityMap, typename SubGraph::EdgeIndexMap > PropertiesGraph
Definition: graphcreator.hh:31
Dune::Amg::SubGraph< MatrixGraph, std::vector< bool > > SubGraph
Definition: graphcreator.hh:25
static void free(GraphTuple &graphs)
Definition: graphcreator.hh:52
The (undirected) graph of a matrix.
Definition: graph.hh:48
Implementation of the BCRSMatrix class.
EdgeIndexMap getEdgeIndexMap()
Get an edge index map for the graph.
Attaches properties to the edges and vertices of a graph.
Definition: graph.hh:975
static void free(GraphTuple &graphs)
Definition: graphcreator.hh:86
Define general, extensible interface for operators. The available implementation wraps a matrix...
Dune::Amg::PropertiesGraph< MatrixGraph, VertexProperties, EdgeProperties, IdentityMap, IdentityMap > PropertiesGraph
Definition: graphcreator.hh:70
Definition: graphcreator.hh:20
std::tuple< MatrixGraph *, PropertiesGraph * > GraphTuple
Definition: graphcreator.hh:72
Class representing a node in the matrix graph.
Definition: dependency.hh:125
M::matrix_type Matrix
Definition: graphcreator.hh:22
static GraphTuple create(const M &matrix, T &excluded, PI &pinfo, const OF &of)
Definition: graphcreator.hh:36
Dune::Amg::MatrixGraph< const Matrix > MatrixGraph
Definition: graphcreator.hh:23
An index map for mapping the edges to indices.
Definition: graph.hh:467
Class representing the properties of an ede in the matrix graph.
Definition: dependency.hh:37
Provides classes for initializing the link attributes of a matrix graph.
Provides classes for building the matrix graph.
A subgraph of a graph.
Definition: graph.hh:440