5#ifndef DUNE_AMGTRANSFER_HH
6#define DUNE_AMGTRANSFER_HH
10#include <dune/istl/paamg/pinfo.hh>
30 template<
class V1,
class V2,
class T>
38 template<
typename T1,
typename R>
39 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
40 Vector& fineRedist,T1 damp, R& redistributor=R());
42 template<
typename T1,
typename R>
43 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
46 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
50 template<
class V,
class V1>
51 class Transfer<V,V1, SequentialInformation>
56 typedef RedistributeInformation<SequentialInformation> Redist;
58 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
59 Vector& fineRedist, T1 damp,
60 const SequentialInformation& comm=SequentialInformation(),
61 const Redist& redist=Redist());
63 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
65 const SequentialInformation& comm=SequentialInformation());
68 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
69 const SequentialInformation& comm);
74 template<
class V,
class V1,
class T1,
class T2>
75 class Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >
80 typedef RedistributeInformation<OwnerOverlapCopyCommunication<T1,T2> > Redist;
82 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
83 Vector& fineRedist, T3 damp, OwnerOverlapCopyCommunication<T1,T2>& comm,
84 const Redist& redist);
86 static void prolongateVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse, Vector& fine,
87 T3 damp, OwnerOverlapCopyCommunication<T1,T2>& comm);
89 static void restrictVector(
const AggregatesMap<Vertex>& aggregates, Vector& coarse,
const Vector& fine,
90 OwnerOverlapCopyCommunication<T1,T2>& comm);
95 template<
class V,
class V1>
98 Transfer<V,V1,SequentialInformation>::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
99 Vector& coarse, Vector& fine,
100 [[maybe_unused]] Vector& fineRedist,
102 [[maybe_unused]]
const SequentialInformation& comm,
103 [[maybe_unused]]
const Redist& redist)
105 prolongateVector(aggregates, coarse, fine, damp);
107 template<
class V,
class V1>
110 Transfer<V,V1,SequentialInformation>::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
111 Vector& coarse, Vector& fine,
113 [[maybe_unused]]
const SequentialInformation& comm)
115 typedef typename Vector::iterator Iterator;
117 Iterator end = coarse.end();
118 Iterator begin= coarse.begin();
119 for(; begin!=end; ++begin)
124 for(Iterator block=begin; block != end; ++block) {
125 std::ptrdiff_t index=block-begin;
126 const Vertex&
vertex = aggregates[index];
128 *block += coarse[aggregates[index]];
132 template<
class V,
class V1>
134 Transfer<V,V1,SequentialInformation>::restrictVector(
const AggregatesMap<Vertex>& aggregates,
137 [[maybe_unused]]
const SequentialInformation& comm)
142 typedef typename Vector::const_iterator Iterator;
143 Iterator end = fine.end();
144 Iterator begin=fine.begin();
146 for(Iterator block=begin; block != end; ++block) {
147 const Vertex&
vertex = aggregates[block-begin];
154 template<
class V,
class V1,
class T1,
class T2>
155 template<
typename T3>
156 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
const AggregatesMap<Vertex>& aggregates,
157 Vector& coarse, Vector& fine,
158 Vector& fineRedist, T3 damp,
159 OwnerOverlapCopyCommunication<T1,T2>& comm,
160 const Redist& redist)
162 if(fineRedist.size()>0)
164 Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fineRedist, damp);
167 redist.redistributeBackward(fine, fineRedist);
168 comm.copyOwnerToAll(fine,fine);
171 template<
class V,
class V1,
class T1,
class T2>
172 template<
typename T3>
173 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::prolongateVector(
174 const AggregatesMap<Vertex>& aggregates,
175 Vector& coarse, Vector& fine, T3 damp,
176 [[maybe_unused]] OwnerOverlapCopyCommunication<T1,T2>& comm)
178 Transfer<V,V1,SequentialInformation>::prolongateVector(aggregates, coarse, fine, damp);
180 template<
class V,
class V1,
class T1,
class T2>
181 inline void Transfer<V,V1,OwnerOverlapCopyCommunication<T1,T2> >::restrictVector(
const AggregatesMap<Vertex>& aggregates,
182 Vector& coarse,
const Vector& fine,
183 OwnerOverlapCopyCommunication<T1,T2>& comm)
185 Transfer<V,V1,SequentialInformation>::restrictVector(aggregates, coarse, fine, SequentialInformation());
188 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:492
static const Vertex ISOLATED
Identifier of isolated vertices.
Definition: aggregates.hh:571
Functionality for redistributing a sparse matrix.
Dune namespace.
Definition: alignedallocator.hh:13
Classes providing communication interfaces for overlapping Schwarz methods.