3#ifndef DUNE_AMGTRANSFER_HH
4#define DUNE_AMGTRANSFER_HH
8#include <dune/istl/paamg/pinfo.hh>
28 template<
class V1,
class V2,
class T>
36 template<
typename T1,
typename R>
37 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
38 Vector& fineRedist,T1 damp, R& redistributor=R());
40 template<
typename T1,
typename R>
41 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
44 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
48 template<
class V,
class V1>
49 class Transfer<V,V1, SequentialInformation>
54 typedef RedistributeInformation<SequentialInformation> Redist;
56 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
57 Vector& fineRedist, T1 damp,
58 const SequentialInformation& comm=SequentialInformation(),
59 const Redist& redist=Redist());
61 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
63 const SequentialInformation& comm=SequentialInformation());
66 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
67 const SequentialInformation& comm);
72 template<
class V,
class V1,
class T1,
class T2>
73 class Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >
78 typedef RedistributeInformation<OwnerOverlapCopyCommunication<T1,T2> > Redist;
80 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
81 Vector& fineRedist, T3 damp, OwnerOverlapCopyCommunication<T1,T2>& comm,
82 const Redist& redist);
84 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
85 T3 damp, OwnerOverlapCopyCommunication<T1,T2>& comm);
87 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
88 OwnerOverlapCopyCommunication<T1,T2>& comm);
93 template<
class V,
class V1>
96 Transfer<V,V1,SequentialInformation>::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
97 Vector& coarse, Vector& fine,
98 [[maybe_unused]] Vector& fineRedist,
100 [[maybe_unused]]
const SequentialInformation& comm,
101 [[maybe_unused]]
const Redist& redist)
103 prolongateVector(aggregates, coarse, fine, damp);
105 template<
class V,
class V1>
108 Transfer<V,V1,SequentialInformation>::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
109 Vector& coarse, Vector& fine,
111 [[maybe_unused]]
const SequentialInformation& comm)
113 typedef typename Vector::iterator Iterator;
115 Iterator end = coarse.end();
116 Iterator begin= coarse.begin();
117 for(; begin!=end; ++begin)
122 for(Iterator block=begin; block != end; ++block) {
123 std::ptrdiff_t index=block-begin;
124 const Vertex&
vertex = aggregates[index];
126 *block += coarse[aggregates[index]];
130 template<
class V,
class V1>
132 Transfer<V,V1,SequentialInformation>::restrictVector(
const AggregatesMap<Vertex>& aggregates,
135 [[maybe_unused]]
const SequentialInformation& comm)
140 typedef typename Vector::const_iterator Iterator;
141 Iterator end = fine.end();
142 Iterator begin=fine.begin();
144 for(Iterator block=begin; block != end; ++block) {
145 const Vertex&
vertex = aggregates[block-begin];
152 template<
class V,
class V1,
class T1,
class T2>
153 template<
typename T3>
154 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
155 Vector& coarse, Vector& fine,
156 Vector& fineRedist, T3 damp,
157 OwnerOverlapCopyCommunication<T1,T2>& comm,
158 const Redist& redist)
160 if(fineRedist.size()>0)
162 Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fineRedist, damp);
165 redist.redistributeBackward(fine, fineRedist);
166 comm.copyOwnerToAll(fine,fine);
169 template<
class V,
class V1,
class T1,
class T2>
170 template<
typename T3>
171 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
172 const AggregatesMap<Vertex>& aggregates,
173 Vector& coarse, Vector& fine, T3 damp,
174 [[maybe_unused]] OwnerOverlapCopyCommunication<T1,T2>& comm)
176 Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fine, damp);
178 template<
class V,
class V1,
class T1,
class T2>
179 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::restrictVector(
const AggregatesMap<Vertex>& aggregates,
180 Vector& coarse,
const Vector& fine,
181 OwnerOverlapCopyCommunication<T1,T2>& comm)
183 Transfer<V,V1,SequentialInformation>::restrictVector(aggregates, coarse, fine, SequentialInformation());
186 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.
constexpr GeometryType vertex
GeometryType representing a vertex.
Definition: type.hh:504
static const Vertex ISOLATED
Identifier of isolated vertices.
Definition: aggregates.hh:569
Functionality for redistributing a sparse matrix.
Dune namespace.
Definition: alignedallocator.hh:11
Classes providing communication interfaces for overlapping Schwarz methods.