3#ifndef DUNE_AMGCONSTRUCTION_HH
4#define DUNE_AMGCONSTRUCTION_HH
9#include <dune/istl/solvercategory.hh>
52 return std::make_shared<T>();
56 template<
class T,
class A>
62 return std::make_shared<BlockVector<T,A>>(n);
66 template<
class M,
class C>
67 struct ParallelOperatorArgs
69 ParallelOperatorArgs(std::shared_ptr<M> matrix,
const C& comm)
70 : matrix_(matrix), comm_(comm)
73 std::shared_ptr<M> matrix_;
78 struct OwnerOverlapCopyCommunicationArgs
81 : comm_(comm), cat_(cat)
89 struct SequentialCommunicationArgs
91 SequentialCommunicationArgs(CollectiveCommunication<void*> comm, [[maybe_unused]]
int cat)
95 CollectiveCommunication<void*> comm_;
101 template<
class M,
class X,
class Y,
class C>
102 class OverlappingSchwarzOperator;
104 template<
class M,
class X,
class Y,
class C>
105 class NonoverlappingSchwarzOperator;
109 template<
class M,
class X,
class Y,
class C>
110 struct ConstructionTraits<OverlappingSchwarzOperator<M,X,Y,C> >
112 typedef ParallelOperatorArgs<M,C>
Arguments;
114 static inline std::shared_ptr<OverlappingSchwarzOperator<M,X,Y,C>>
construct(
const Arguments& args)
116 return std::make_shared<OverlappingSchwarzOperator<M,X,Y,C>>
117 (args.matrix_, args.comm_);
121 template<
class M,
class X,
class Y,
class C>
122 struct ConstructionTraits<NonoverlappingSchwarzOperator<M,X,Y,C> >
124 typedef ParallelOperatorArgs<M,C>
Arguments;
126 static inline std::shared_ptr<NonoverlappingSchwarzOperator<M,X,Y,C>>
construct(
const Arguments& args)
128 return std::make_shared<NonoverlappingSchwarzOperator<M,X,Y,C>>
129 (args.matrix_, args.comm_);
133 template<
class M,
class X,
class Y>
134 struct MatrixAdapterArgs
136 MatrixAdapterArgs(std::shared_ptr<M> matrix,
const SequentialInformation)
140 std::shared_ptr<M> matrix_;
143 template<
class M,
class X,
class Y>
144 struct ConstructionTraits<MatrixAdapter<M,X,Y> >
146 typedef const MatrixAdapterArgs<M,X,Y>
Arguments;
150 return std::make_shared<MatrixAdapter<M,X,Y>>(args.matrix_);
155 struct ConstructionTraits<SequentialInformation>
157 typedef const SequentialCommunicationArgs
Arguments;
160 return std::make_shared<SequentialInformation>(args.comm_);
167 template<
class T1,
class T2>
168 struct ConstructionTraits<OwnerOverlapCopyCommunication<T1,T2> >
170 typedef const OwnerOverlapCopyCommunicationArgs
Arguments;
172 static inline std::shared_ptr<OwnerOverlapCopyCommunication<T1,T2>>
construct(
Arguments& args)
174 return std::make_shared<OwnerOverlapCopyCommunication<T1,T2>>(args.comm_, args.cat_);
This file implements a vector space as a tensor product of a given vector space. The number of compon...
A vector of blocks with memory management.
Definition: bvector.hh:393
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
Dune namespace.
Definition: alignedallocator.hh:11
Define general, extensible interface for operators. The available implementation wraps a matrix.
Classes providing communication interfaces for overlapping Schwarz methods.
Traits class for generically constructing non default constructable types.
Definition: construction.hh:37
Category
Definition: solvercategory.hh:21