dune-istl  2.8.0
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 
6 #include <dune/istl/bvector.hh>
7 #include <dune/istl/operators.hh>
10 #include "pinfo.hh"
11 
12 namespace Dune
13 {
14  namespace Amg
15  {
16 
35  template<typename T>
37  {
42  typedef const void* Arguments;
43 
50  static inline std::shared_ptr<T> construct(Arguments& args)
51  {
52  return std::make_shared<T>();
53  }
54  };
55 
56  template<class T, class A>
58  {
59  typedef const int Arguments;
60  static inline std::shared_ptr<BlockVector<T,A>> construct(Arguments& n)
61  {
62  return std::make_shared<BlockVector<T,A>>(n);
63  }
64  };
65 
66  template<class M, class C>
68  {
69  ParallelOperatorArgs(std::shared_ptr<M> matrix, const C& comm)
70  : matrix_(matrix), comm_(comm)
71  {}
72 
73  std::shared_ptr<M> matrix_;
74  const C& comm_;
75  };
76 
77 #if HAVE_MPI
79  {
81  : comm_(comm), cat_(cat)
82  {}
83 
84  MPI_Comm comm_;
86  };
87 #endif
88 
90  {
91  SequentialCommunicationArgs(CollectiveCommunication<void*> comm, [[maybe_unused]] int cat)
92  : comm_(comm)
93  {}
94 
95  CollectiveCommunication<void*> comm_;
96  };
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>
111  {
113 
114  static inline std::shared_ptr<OverlappingSchwarzOperator<M,X,Y,C>> construct(const Arguments& args)
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>
123  {
125 
126  static inline std::shared_ptr<NonoverlappingSchwarzOperator<M,X,Y,C>> construct(const Arguments& args)
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>
135  {
136  MatrixAdapterArgs(std::shared_ptr<M> matrix, const SequentialInformation)
137  : matrix_(matrix)
138  {}
139 
140  std::shared_ptr<M> matrix_;
141  };
142 
143  template<class M, class X, class Y>
145  {
147 
148  static inline std::shared_ptr<MatrixAdapter<M,X,Y>> construct(Arguments& args)
149  {
150  return std::make_shared<MatrixAdapter<M,X,Y>>(args.matrix_);
151  }
152  };
153 
154  template<>
156  {
158  static inline std::shared_ptr<SequentialInformation> construct(Arguments& args)
159  {
160  return std::make_shared<SequentialInformation>(args.comm_);
161  }
162  };
163 
164 
165 #if HAVE_MPI
166 
167  template<class T1, class T2>
169  {
171 
172  static inline std::shared_ptr<OwnerOverlapCopyCommunication<T1,T2>> construct(Arguments& args)
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...
Define general, extensible interface for operators. The available implementation wraps a matrix.
Classes providing communication interfaces for overlapping Schwarz methods.
CollectiveCommunication< void * > comm_
Definition: construction.hh:95
const int Arguments
Definition: construction.hh:59
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
static std::shared_ptr< BlockVector< T, A > > construct(Arguments &n)
Definition: construction.hh:60
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
SequentialCommunicationArgs(CollectiveCommunication< void * > comm, [[maybe_unused]] int cat)
Definition: construction.hh:91
Definition: allocator.hh:9
A vector of blocks with memory management.
Definition: bvector.hh:393
A nonoverlapping operator with communication object.
Definition: novlpschwarz.hh:62
Traits class for generically constructing non default constructable types.
Definition: construction.hh:37
Adapter to turn a matrix into a linear operator.
Definition: operators.hh:135
A class setting up standard communication for a two-valued attribute set with owner/overlap/copy sema...
Definition: owneroverlapcopy.hh:172
Definition: construction.hh:68
Definition: construction.hh:79
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
static std::shared_ptr< SequentialInformation > construct(Arguments &args)
Definition: construction.hh:158
const SequentialCommunicationArgs Arguments
Definition: construction.hh:157
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