Skip to content
Snippets Groups Projects
Commit bf0d71ad authored by Markus Blatt's avatar Markus Blatt
Browse files

make initSolverFactories only take one template parameter.

It is the linear operator anyway. Hence we can deduce the rest.
parent 935e8e77
No related branches found
No related tags found
No related merge requests found
......@@ -47,22 +47,33 @@ namespace Dune{
the factories with the corresponding Matrix and Vector types.
@tparam O the assembled linear operator type
@tparam X the Domain type
@tparam Y the Range type
*/
template<class O, class X, class Y>
template<class O>
int initSolverFactories(){
using M = typename O::matrix_type;
using X = typename O::range_type;
using Y = typename O::domain_type;
using TL = Dune::TypeList<M,X,Y>;
auto& dsfac=Dune::DirectSolverFactory<M,X,Y>::instance();
addRegistryToFactory<TL>(dsfac, DirectSolverTag{});
using TLO = Dune::TypeList<O,X,Y>;
auto& pfac=Dune::PreconditionerFactory<O,X,Y>::instance();
addRegistryToFactory<TL>(pfac, PreconditionerTag{});
using TLS = Dune::TypeList<X,Y>;
auto& isfac=Dune::IterativeSolverFactory<X,Y>::instance();
return addRegistryToFactory<TLS>(isfac, IterativeSolverTag{});
}
/* initializes the direct solvers, preconditioners and iterative solvers in
the factories with the corresponding Matrix and Vector types.
@tparam O the assembled linear operator type
@tparam X the Domain type
@tparam Y the Range type
*/
template<class O, class X, class Y>
int DUNE_DEPRECATED_MSG("Use method 'initSolverFactories<O>' instead")
initSolverFactories() {
return initSolverFactories<O>();
}
} // end anonymous namespace
......
......@@ -152,10 +152,10 @@ int main(int argc, char** argv){
Dune::ParameterTreeParser::readINITree("solverfactorytest.ini", config);
Dune::ParameterTreeParser::readOptions(argc, argv, config);
Dune::initSolverFactories<Dune::MatrixAdapter<Matrix,Vector,Vector>,Vector,Vector>();
Dune::initSolverFactories<Dune::MatrixAdapter<Matrix,Vector,Vector>>();
using Communication = Dune::OwnerOverlapCopyCommunication<int>;
Dune::initSolverFactories<Dune::OverlappingSchwarzOperator<Matrix,Vector,Vector,Communication>,Vector,Vector>();
Dune::initSolverFactories<Dune::NonoverlappingSchwarzOperator<Matrix,Vector,Vector,Communication>,Vector,Vector>();
Dune::initSolverFactories<Dune::OverlappingSchwarzOperator<Matrix,Vector,Vector,Communication>>();
Dune::initSolverFactories<Dune::NonoverlappingSchwarzOperator<Matrix,Vector,Vector,Communication>>();
std::cout << std::endl << " Testing sequential tests... " << std::endl;
testSeq(config.sub("sequential"), mpihelper.getCollectiveCommunication());
......
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