3#ifndef DUNE_AMGTRANSFER_HH
4#define DUNE_AMGTRANSFER_HH
8#include <dune/istl/paamg/pinfo.hh>
29 template<
class V1,
class V2,
class T>
37 template<
typename T1,
typename R>
38 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
39 Vector& fineRedist,T1 damp, R& redistributor=R());
41 template<
typename T1,
typename R>
42 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
45 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
49 template<
class V,
class V1>
50 class Transfer<V,V1, SequentialInformation>
55 typedef RedistributeInformation<SequentialInformation> Redist;
57 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
58 Vector& fineRedist, T1 damp,
59 const SequentialInformation& comm=SequentialInformation(),
60 const Redist& redist=Redist());
62 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
64 const SequentialInformation& comm=SequentialInformation());
67 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
68 const SequentialInformation& comm);
73 template<
class V,
class V1,
class T1,
class T2>
74 class Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >
79 typedef RedistributeInformation<OwnerOverlapCopyCommunication<T1,T2> > Redist;
81 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
82 Vector& fineRedist, T3 damp, OwnerOverlapCopyCommunication<T1,T2>& comm,
83 const Redist& redist);
85 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
86 T3 damp, OwnerOverlapCopyCommunication<T1,T2>& comm);
88 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
89 OwnerOverlapCopyCommunication<T1,T2>& comm);
94 template<
class V,
class V1>
97 Transfer<V,V1,SequentialInformation>::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
98 Vector& coarse, Vector& fine, Vector& fineRedist,
100 const SequentialInformation& comm,
101 const Redist& redist)
106 prolongateVector(aggregates, coarse, fine, damp);
108 template<
class V,
class V1>
111 Transfer<V,V1,SequentialInformation>::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
112 Vector& coarse, Vector& fine,
114 const SequentialInformation& comm)
117 typedef typename Vector::iterator Iterator;
119 Iterator end = coarse.end();
120 Iterator begin= coarse.begin();
121 for(; begin!=end; ++begin)
126 for(Iterator block=begin; block != end; ++block) {
127 std::ptrdiff_t index=block-begin;
128 const Vertex& vertex = aggregates[index];
130 *block += coarse[aggregates[index]];
134 template<
class V,
class V1>
136 Transfer<V,V1,SequentialInformation>::restrictVector(
const AggregatesMap<Vertex>& aggregates,
139 const SequentialInformation& comm)
145 typedef typename Vector::const_iterator Iterator;
146 Iterator end = fine.end();
147 Iterator begin=fine.begin();
149 for(Iterator block=begin; block != end; ++block) {
150 const Vertex& vertex = aggregates[block-begin];
152 coarse[vertex] += *block;
157 template<
class V,
class V1,
class T1,
class T2>
158 template<
typename T3>
159 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
160 Vector& coarse, Vector& fine,
161 Vector& fineRedist, T3 damp,
162 OwnerOverlapCopyCommunication<T1,T2>& comm,
163 const Redist& redist)
165 if(fineRedist.size()>0)
167 Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fineRedist, damp);
170 redist.redistributeBackward(fine, fineRedist);
171 comm.copyOwnerToAll(fine,fine);
174 template<
class V,
class V1,
class T1,
class T2>
175 template<
typename T3>
176 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
177 Vector& coarse, Vector& fine,
179 OwnerOverlapCopyCommunication<T1,T2>& comm)
182 Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fine, damp);
184 template<
class V,
class V1,
class T1,
class T2>
185 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::restrictVector(
const AggregatesMap<Vertex>& aggregates,
186 Vector& coarse,
const Vector& fine,
187 OwnerOverlapCopyCommunication<T1,T2>& comm)
189 Transfer<V,V1,SequentialInformation>::restrictVector(aggregates, coarse, fine, SequentialInformation());
192 comm.project(coarse);
Provides classes for the Coloring process of AMG.
This file implements a vector space as a tensor product of a given vector space. The number of compon...
A few common exception classes.
static const Vertex ISOLATED
Identifier of isolated vertices.
Definition: aggregates.hh:554
Functionality for redistributing a sparse matrix.
Dune namespace.
Definition: alignment.hh:11
Classes providing communication interfaces for overlapping Schwarz methods.
Definition of the DUNE_UNUSED macro for the case that config.h is not available.
#define DUNE_UNUSED_PARAMETER(parm)
A macro to mark intentionally unused function parameters with.
Definition: unused.hh:18