Skip to content
Snippets Groups Projects
Commit c949657a authored by Simon Praetorius's avatar Simon Praetorius
Browse files

Add specialization of ConstructionTraits for Richardson

parent 85fce383
No related branches found
No related tags found
1 merge request!304Add specialization of ConstructionTraits for Richardson
......@@ -67,19 +67,22 @@ namespace Dune
};
template<class X, class Y, class C, class T>
struct SmootherTraits<BlockPreconditioner<X,Y,C,T> >
template<class X, class Y>
struct SmootherTraits<Richardson<X,Y>>
{
typedef DefaultSmootherArgs<typename T::matrix_type::field_type> Arguments;
typedef DefaultSmootherArgs<typename X::field_type> Arguments;
};
template<class X, class Y, class C, class T>
struct SmootherTraits<BlockPreconditioner<X,Y,C,T> >
: public SmootherTraits<T>
{};
template<class C, class T>
struct SmootherTraits<NonoverlappingBlockPreconditioner<C,T> >
{
typedef DefaultSmootherArgs<typename T::matrix_type::field_type> Arguments;
};
: public SmootherTraits<T>
{};
/**
* @brief Construction Arguments for the default smoothers
......@@ -168,6 +171,49 @@ namespace Dune
};
template<class X, class Y>
class DefaultConstructionArgs<Richardson<X,Y>>
{
typedef Richardson<X,Y> T;
typedef typename SmootherTraits<T>::Arguments SmootherArgs;
public:
virtual ~DefaultConstructionArgs()
{}
template <class... Args>
void setMatrix(const Args&...)
{}
void setArgs(const SmootherArgs& args)
{
args_=&args;
}
template<class T1>
void setComm(T1& comm)
{
DUNE_UNUSED_PARAMETER(comm);
}
const SequentialInformation& getComm()
{
return comm_;
}
const SmootherArgs getArgs() const
{
return *args_;
}
private:
const SmootherArgs* args_;
SequentialInformation comm_;
};
template<class T>
class ConstructionTraits;
......@@ -217,6 +263,21 @@ namespace Dune
}
};
/**
* @brief Policy for the construction of the SeqJac smoother
*/
template<class X, class Y>
struct ConstructionTraits<Richardson<X,Y> >
{
typedef DefaultConstructionArgs<Richardson<X,Y> > Arguments;
static inline std::shared_ptr<Richardson<X,Y>> construct(Arguments& args)
{
return std::make_shared<Richardson<X,Y>>
(args.getArgs().relaxationFactor);
}
};
DUNE_NO_DEPRECATED_BEGIN // for deprecated SeqILU0
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment