Skip to content

Commit 4860722

Browse files
Merge Pull Request trilinos#11739 from bartlettroscoe/Trilinos/11730-tril-lin-solv-proto-1
Automatically Merged using Trilinos Pull Request AutoTester PR Title: Changes to Trilinos for new external TrilinosLinearSolvers package (trilinos#11730) PR Author: bartlettroscoe
2 parents f1408d2 + f00dcbc commit 4860722

File tree

103 files changed

+1123
-616
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+1123
-616
lines changed

.gitdist.default

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ packages/xSDKTrilinos
99
packages/framework/GenConfig
1010
packages/framework/son-ini-files
1111
packages/framework/srn-ini-files
12+
packages/trilinos_linear_solvers
1213
TriBITS
1314
TriBITS/TriBITSDoc
1415
run_trilinos_pr_builds

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ doxygen_objdb_*.tmp
3232
/packages/moocho/
3333
/packages/optika/
3434
/packages/xSDKTrilinos/
35+
/packages/trilinos_linear_solvers/
3536

3637
# Ignore local gitdist config file (.gitdis.default is in git repo)
3738
/.gitdist

PackagesList.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@ TRIBITS_REPOSITORY_DEFINE_PACKAGES(
122122
NOX packages/nox PT
123123
Moertel packages/moertel ST
124124
MueLu packages/muelu PT
125+
TrilinosLinearSolvers packages/trilinos_linear_solvers PT
125126
Zoltan2Sphynx packages/zoltan2/sphynx PT
126127
Zoltan2 packages/zoltan2 PT
127128
ShyLU_DD packages/shylu/shylu_dd PT
@@ -174,6 +175,7 @@ TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(WebTrilinos)
174175
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(xSDKTrilinos)
175176
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(SGM)
176177
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(UMR)
178+
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(TrilinosLinearSolvers)
177179

178180
# TRILFRAME-500
179181
TRIBITS_ALLOW_MISSING_EXTERNAL_PACKAGES(Rythmos) # 27115 targets

packages/ifpack2/adapters/thyra/Thyra_Ifpack2PreconditionerFactory_def.hpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,17 @@ Ifpack2PreconditionerFactory<MatrixType>::getValidParameters() const
392392
template <typename MatrixType>
393393
std::string Ifpack2PreconditionerFactory<MatrixType>::description() const
394394
{
395-
return "Thyra::Ifpack2PreconditionerFactory";
395+
std::ostringstream oss;
396+
oss << "Thyra::Ifpack2PreconditionerFactory";
397+
oss << "{";
398+
std::string *precTypePtr = nullptr;
399+
if (nonnull(paramList_) &&
400+
(precTypePtr = Teuchos::getParameterPtr<std::string>(*paramList_, "Prec Type")) )
401+
{
402+
oss << "\"Prec Type\" = \"" << *precTypePtr << "\"";
403+
}
404+
oss << "}";
405+
return oss.str();
396406
}
397407

398408

packages/intrepid2/doc/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/html/
2+
/latex/

packages/muelu/adapters/stratimikos/Xpetra_ThyraLinearOp.hpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@
6060
#include <Teuchos_AbstractFactoryStd.hpp>
6161
#include <Stratimikos_LinearSolverBuilder.hpp>
6262
#include <Thyra_MueLuPreconditionerFactory.hpp>
63-
# ifdef HAVE_MUELU_IFPACK2
64-
# include <Thyra_Ifpack2PreconditionerFactory.hpp>
65-
# endif
6663

6764

6865
namespace MueLu {
@@ -157,11 +154,6 @@ namespace MueLu {
157154
typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
158155
typedef Thyra::MueLuPreconditionerFactory<Scalar, LocalOrdinal, GlobalOrdinal, Node> ImplMueLu;
159156
linearSolverBuilder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, ImplMueLu>(), "MueLu");
160-
#ifdef HAVE_MUELU_IFPACK2
161-
// Register Ifpack2 as a Stratimikos preconditioner strategy.
162-
typedef Thyra::Ifpack2PreconditionerFactory<Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > Impl;
163-
linearSolverBuilder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), "Ifpack2");
164-
#endif
165157

166158
linearSolverBuilder.setParameterList(params);
167159

packages/muelu/example/basic/Stratimikos.cpp

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,6 @@ The source code is not MueLu specific and can be used with any Stratimikos strat
8282
// Galeri includes
8383
#include <Galeri_XpetraParameters.hpp>
8484

85-
// Ifpack2 includes
86-
#ifdef HAVE_MUELU_IFPACK2
87-
#include <Thyra_Ifpack2PreconditionerFactory.hpp>
88-
#endif
89-
9085

9186
template<typename Scalar,class LocalOrdinal,class GlobalOrdinal,class Node>
9287
int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib lib, int argc, char *argv[]) {
@@ -196,12 +191,6 @@ int main_(Teuchos::CommandLineProcessor &clp, Xpetra::UnderlyingLib lib, int arg
196191
Stratimikos::LinearSolverBuilder<Scalar> linearSolverBuilder;
197192
// Register MueLu as a Stratimikos preconditioner strategy.
198193
Stratimikos::enableMueLu<Scalar,LocalOrdinal,GlobalOrdinal,Node>(linearSolverBuilder);
199-
#ifdef HAVE_MUELU_IFPACK2
200-
// Register Ifpack2 as a Stratimikos preconditioner strategy.
201-
typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
202-
typedef Thyra::Ifpack2PreconditionerFactory<Tpetra::CrsMatrix<Scalar,LocalOrdinal,GlobalOrdinal,Node> > Impl;
203-
linearSolverBuilder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), "Ifpack2");
204-
#endif
205194

206195
// add coordinates and nullspace to parameter list
207196
if (paramList->isSublist("Preconditioner Types") &&

packages/muelu/example/basic/Teko.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,6 @@
7575
#include "Stratimikos_DefaultLinearSolverBuilder.hpp"
7676
#include "Stratimikos_MueLuHelpers.hpp"
7777

78-
#include "Thyra_Ifpack2PreconditionerFactory.hpp"
79-
8078

8179
// Belos includes
8280
#include "BelosConfigDefs.hpp"
@@ -200,17 +198,12 @@ void ReadSplittingFromDisk(const std::string & partitionFile,
200198
template<class SC,class LO, class GO, class NO>
201199
int solve_thyra(RCP<Tpetra::CrsMatrix<SC,LO,GO,NO> > & crsMat, const std::string &xmlFile) {
202200
typedef Tpetra::CrsMatrix<SC> TP_Crs;
203-
typedef Thyra::PreconditionerFactoryBase<SC> Base;
204-
typedef Thyra::Ifpack2PreconditionerFactory<TP_Crs> Impl;
205201

206202
typedef Thyra::MultiVectorBase<SC> MV;
207203
typedef Thyra::LinearOpBase<SC> OP;
208204
auto comm = crsMat->getRowMap()->getComm();
209205

210-
// tell Stratimikos => Teko about Ifpack2
211206
RCP<Stratimikos::DefaultLinearSolverBuilder> linearSolverBuilder = Teuchos::rcp(new Stratimikos::DefaultLinearSolverBuilder);
212-
linearSolverBuilder->setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), "Ifpack2");
213-
214207

215208
/////////////////////////////////////////////////////////
216209
// Build the Thyra operators
@@ -285,7 +278,6 @@ template<class SC,class LO, class GO, class NO>
285278
//typedef Tpetra::Vector<SC> TP_Vec;
286279
typedef Tpetra::CrsMatrix<SC> TP_Crs;
287280
typedef Thyra::PreconditionerFactoryBase<SC> Base;
288-
typedef Thyra::Ifpack2PreconditionerFactory<TP_Crs> Impl;
289281

290282
typedef Thyra::MultiVectorBase<SC> MV;
291283
typedef Thyra::LinearOpBase<SC> OP;
@@ -295,7 +287,6 @@ template<class SC,class LO, class GO, class NO>
295287

296288
// tell Stratimikos => Teko about MueLu
297289
RCP<Stratimikos::DefaultLinearSolverBuilder> linearSolverBuilder = Teuchos::rcp(new Stratimikos::DefaultLinearSolverBuilder);
298-
linearSolverBuilder->setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), "Ifpack2");
299290
Stratimikos::enableMueLu<SC,LO,GO,NO>(*linearSolverBuilder);
300291

301292
/////////////////////////////////////////////////////////

packages/muelu/research/q2q1/Q2Q1.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@
7777

7878
#include <Thyra_DefaultPreconditioner.hpp>
7979
#include <Thyra_DefaultScaledAdjointLinearOp.hpp>
80-
#include <Thyra_Ifpack2PreconditionerFactory.hpp>
8180
#include <Thyra_LinearOpWithSolveBase.hpp>
8281
#include <Thyra_LinearOpWithSolveBase.hpp>
8382
#include <Thyra_LinearOpWithSolveFactoryBase.hpp>
@@ -324,7 +323,6 @@ int main(int argc, char *argv[]) {
324323

325324
// Stratimikos vodou
326325
typedef Thyra::PreconditionerFactoryBase<SC> Base;
327-
typedef Thyra::Ifpack2PreconditionerFactory<tCrsMatrix > Impl;
328326
typedef Thyra::LinearOpWithSolveFactoryBase<SC> LOWSFB;
329327
typedef Thyra::LinearOpWithSolveBase<SC> LOWSB;
330328
typedef Thyra::MultiVectorBase<SC> TH_Mvb;

packages/muelu/src/Smoothers/MueLu_StratimikosSmoother_def.hpp

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@
6666

6767
#include <Stratimikos_DefaultLinearSolverBuilder.hpp>
6868
#include "Teuchos_AbstractFactoryStd.hpp"
69-
#if defined(HAVE_MUELU_THYRATPETRAADAPTERS) && defined(HAVE_MUELU_IFPACK2)
70-
#include <Thyra_Ifpack2PreconditionerFactory.hpp>
71-
#endif
69+
#include <Teuchos_ParameterList.hpp>
7270
#include <unordered_map>
7371

7472

@@ -132,11 +130,6 @@ namespace MueLu {
132130
#endif
133131
}
134132

135-
typedef Thyra::PreconditionerFactoryBase<Scalar> Base;
136-
#if defined(HAVE_MUELU_THYRATPETRAADAPTERS) && defined(HAVE_MUELU_IFPACK2)
137-
typedef Thyra::Ifpack2PreconditionerFactory<Tpetra::CrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node> > Impl;
138-
linearSolverBuilder.setPreconditioningStrategyFactory(Teuchos::abstractFactoryStd<Base, Impl>(), "Ifpack2");
139-
#endif
140133
linearSolverBuilder.setParameterList(rcpFromRef(const_cast<ParameterList&>(this->GetParameterList())));
141134

142135

0 commit comments

Comments
 (0)