Debian Codegraph @

packages/shylu/shylu_dd/frosch/src/Adapters/Stratimikos_FROSch_def.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // ShyLU: Scalable Hybrid LU Preconditioner and Solver
4 //
5 // Copyright 2011 NTESS and the ShyLU contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef _STRATIMIKOS_FROSCH_DEF_HPP
11 #define _STRATIMIKOS_FROSCH_DEF_HPP
12
13 #include "Stratimikos_FROSch_decl.hpp"
14
15 #include "Thyra_FROSchFactory_def.hpp"
16
17
18 namespace Stratimikos {
19
20 using namespace std;
21 using namespace Teuchos;
22 using namespace Thyra;
23
24 template <typename LO,typename GO,typename NO>
25 void enableFROSch (LinearSolverBuilder<double>& builder,
26 const string& stratName)
27 {
28 const RCP<const ParameterList> precValidParams = sublist(builder.getValidParameters(), "Preconditioner Types");
29
30 TEUCHOS_TEST_FOR_EXCEPTION(precValidParams->isParameter(stratName), logic_error,
31 "Stratimikos::enableFROSch cannot add \"" + stratName +"\" because it is already included in builder!");
32
33 using Base = PreconditionerFactoryBase<double>;
34 if (!stratName.compare("FROSch")) {
35 using Impl = FROSchFactory<double, LO, GO, NO>;
36 builder.setPreconditioningStrategyFactory(abstractFactoryStd<Base, Impl>(), stratName);
37 }
38 }
39
40 template <typename SC, typename LO,typename GO,typename NO>
41 void enableFROSch (LinearSolverBuilder<SC>& builder,
42 const string& stratName)
43 {
44 const RCP<const ParameterList> precValidParams = sublist(builder.getValidParameters(), "Preconditioner Types");
45
46 TEUCHOS_TEST_FOR_EXCEPTION(precValidParams->isParameter(stratName), logic_error,
47 "Stratimikos::enableFROSch cannot add \"" + stratName +"\" because it is already included in builder!");
48
49 using Base = PreconditionerFactoryBase<SC>;
50 if (!stratName.compare("FROSch")) {
51 using Impl = FROSchFactory<SC, LO, GO, NO>;
52 builder.setPreconditioningStrategyFactory(abstractFactoryStd<Base, Impl>(), stratName);
53 }
54 }
55
56 } // namespace Stratimikos
57
58 #endif