dune-istl 2.8.0
Loading...
Searching...
No Matches
construction.hh
Go to the documentation of this file.
1// -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2// vi: set et ts=4 sw=2 sts=2:
3#ifndef DUNE_AMGCONSTRUCTION_HH
4#define DUNE_AMGCONSTRUCTION_HH
5
10#include "pinfo.hh"
11
12namespace Dune
13{
14 namespace Amg
15 {
16
35 template<typename T>
36 struct ConstructionTraits
37 {
42 typedef const void* Arguments;
43
51 {
52 return std::make_shared<T>();
53 }
54 };
55
56 template<class T, class A>
57 struct ConstructionTraits<BlockVector<T,A> >
58 {
59 typedef const int Arguments;
61 {
62 return std::make_shared<BlockVector<T,A>>(n);
63 }
64 };
65
66 template<class M, class C>
68 {
70 : matrix_(matrix), comm_(comm)
71 {}
72
74 const C& comm_;
75 };
76
77#if HAVE_MPI
87#endif
88
97
98 } // end Amg namspace
99
100 // forward declaration
101 template<class M, class X, class Y, class C>
103
104 template<class M, class X, class Y, class C>
106
107 namespace Amg
108 {
109 template<class M, class X, class Y, class C>
110 struct ConstructionTraits<OverlappingSchwarzOperator<M,X,Y,C> >
111 {
113
115 {
116 return std::make_shared<OverlappingSchwarzOperator<M,X,Y,C>>
117 (args.matrix_, args.comm_);
118 }
119 };
120
121 template<class M, class X, class Y, class C>
122 struct ConstructionTraits<NonoverlappingSchwarzOperator<M,X,Y,C> >
123 {
125
127 {
128 return std::make_shared<NonoverlappingSchwarzOperator<M,X,Y,C>>
129 (args.matrix_, args.comm_);
130 }
131 };
132
133 template<class M, class X, class Y>
142
143 template<class M, class X, class Y>
144 struct ConstructionTraits<MatrixAdapter<M,X,Y> >
145 {
147
149 {
150 return std::make_shared<MatrixAdapter<M,X,Y>>(args.matrix_);
151 }
152 };
153
154 template<>
155 struct ConstructionTraits<SequentialInformation>
156 {
159 {
160 return std::make_shared<SequentialInformation>(args.comm_);
161 }
162 };
163
164
165#if HAVE_MPI
166
167 template<class T1, class T2>
168 struct ConstructionTraits<OwnerOverlapCopyCommunication<T1,T2> >
169 {
171
173 {
174 return std::make_shared<OwnerOverlapCopyCommunication<T1,T2>>(args.comm_, args.cat_);
175 }
176 };
177
178#endif
179
181 } // namespace Amg
182} // namespace Dune
183#endif
This file implements a vector space as a tensor product of a given vector space. The number of compon...
Classes providing communication interfaces for overlapping Schwarz methods.
Define general, extensible interface for operators. The available implementation wraps a matrix.
CollectiveCommunication< void * > comm_
Definition construction.hh:95
const int Arguments
Definition construction.hh:59
SequentialCommunicationArgs(CollectiveCommunication< void * > comm, int cat)
Definition construction.hh:91
OwnerOverlapCopyCommunicationArgs(MPI_Comm comm, SolverCategory::Category cat)
Definition construction.hh:80
MPI_Comm comm_
Definition construction.hh:84
SolverCategory::Category cat_
Definition construction.hh:85
const C & comm_
Definition construction.hh:74
ParallelOperatorArgs(std::shared_ptr< M > matrix, const C &comm)
Definition construction.hh:69
std::shared_ptr< M > matrix_
Definition construction.hh:73
const void * Arguments
A type holding all the arguments needed to call the constructor.
Definition construction.hh:42
static std::shared_ptr< T > construct(Arguments &args)
Construct an object with the specified arguments.
Definition construction.hh:50
static std::shared_ptr< BlockVector< T, A > > construct(Arguments &n)
Definition construction.hh:60
static constexpr size_type M()
A vector of blocks with memory management.
Definition bvector.hh:393
A nonoverlapping operator with communication object.
Definition novlpschwarz.hh:62
Adapter to turn a matrix into a linear operator.
Definition operators.hh:135
Definition construction.hh:68
Definition construction.hh:90
An overlapping Schwarz operator.
Definition schwarz.hh:76
ParallelOperatorArgs< M, C > Arguments
Definition construction.hh:112
static std::shared_ptr< OverlappingSchwarzOperator< M, X, Y, C > > construct(const Arguments &args)
Definition construction.hh:114
ParallelOperatorArgs< M, C > Arguments
Definition construction.hh:124
static std::shared_ptr< NonoverlappingSchwarzOperator< M, X, Y, C > > construct(const Arguments &args)
Definition construction.hh:126
Definition construction.hh:135
MatrixAdapterArgs(std::shared_ptr< M > matrix, const SequentialInformation)
Definition construction.hh:136
std::shared_ptr< M > matrix_
Definition construction.hh:140
static std::shared_ptr< MatrixAdapter< M, X, Y > > construct(Arguments &args)
Definition construction.hh:148
const MatrixAdapterArgs< M, X, Y > Arguments
Definition construction.hh:146
const SequentialCommunicationArgs Arguments
Definition construction.hh:157
static std::shared_ptr< SequentialInformation > construct(Arguments &args)
Definition construction.hh:158
static std::shared_ptr< OwnerOverlapCopyCommunication< T1, T2 > > construct(Arguments &args)
Definition construction.hh:172
const OwnerOverlapCopyCommunicationArgs Arguments
Definition construction.hh:170
Definition pinfo.hh:26
Category
Definition solvercategory.hh:21