Debian Codegraph @

packages/shylu/shylu_dd/frosch/src/SolverInterfaces/FROSch_MueLuPreconditioner_decl.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 _FROSCH_MUELUPRECONDITIONER_DECL_HPP
11 #define _FROSCH_MUELUPRECONDITIONER_DECL_HPP
12
13 #include <ShyLU_DDFROSch_config.h>
14
15 #include <MueLu_TpetraOperator.hpp>
16 #include <MueLu_CreateTpetraPreconditioner.hpp>
17 #include <MueLu_Utilities.hpp>
18
19 // FROSch
20 #include <FROSch_Solver_def.hpp>
21
22
23 namespace FROSch {
24
25 using namespace Teuchos;
26 using namespace Xpetra;
27
28 template <class SC = double,
29 class LO = int,
30 class GO = DefaultGlobalOrdinal,
31 class NO = Tpetra::KokkosClassic::DefaultNode::DefaultNodeType>
32 class MueLuPreconditioner : public Solver<SC,LO,GO,NO> {
33
34 protected:
35
36 // Xpetra
37 using XMatrix = typename Solver<SC,LO,GO,NO>::XMatrix;
38 using XMatrixPtr = typename Solver<SC,LO,GO,NO>::XMatrixPtr;
39 using ConstXMatrixPtr = typename Solver<SC,LO,GO,NO>::ConstXMatrixPtr;
40
41 using XMultiVector = typename Solver<SC,LO,GO,NO>::XMultiVector;
42 using XMultiVectorPtr = typename Solver<SC,LO,GO,NO>::XMultiVectorPtr;
43 using ConstXMultiVectorPtr = typename Solver<SC,LO,GO,NO>::ConstXMultiVectorPtr;
44
45 using XMultiVectorFactory = typename Solver<SC,LO,GO,NO>::XMultiVectorFactory;
46
47 // Teuchos
48 using ParameterListPtr = typename Solver<SC,LO,GO,NO>::ParameterListPtr;
49
50 // MueLu
51 using MueLuFactoryPtr = RCP<MueLu::HierarchyManager<SC,LO,GO,NO> >;
52 using MueLuHierarchyPtr = RCP<MueLu::Hierarchy<SC,LO,GO,NO> >;
53
54 public:
55
56 //! Initialize the internal solver
57 virtual int initialize();
58
59 //! Compute the internal solver
60 virtual int compute();
61
62 /*!
63 \brief Computes the operator-multivector application.
64
65 Loosely, performs \f$Y = \alpha \cdot A^{\textrm{mode}} \cdot X + \beta \cdot Y\f$. However, the details of operation
66 vary according to the values of \c alpha and \c beta. Specifically
67 - if <tt>beta == 0</tt>, apply() <b>must</b> overwrite \c Y, so that any values in \c Y (including NaNs) are ignored.
68 - if <tt>alpha == 0</tt>, apply() <b>may</b> short-circuit the operator, so that any values in \c X (including NaNs) are ignored.
69 */
70 void apply(const XMultiVector &x,
71 XMultiVector &y,
72 ETransp mode=NO_TRANS,
73 SC alpha=ScalarTraits<SC>::one(),
74 SC beta=ScalarTraits<SC>::zero()) const;
75
76 int updateMatrix(ConstXMatrixPtr k,
77 bool reuseInitialize=false);
78
79 protected:
80
81 //! Constructor
82 MueLuPreconditioner(ConstXMatrixPtr k,
83 ParameterListPtr parameterList,
84 string description);
85
86 mutable XMultiVectorPtr Y_ = null;
87
88 MueLuFactoryPtr MueLuFactory_ = null;
89
90 MueLuHierarchyPtr MueLuHierarchy_ = null;
91
92 friend class SolverFactory<SC,LO,GO,NO>;
93 };
94
95 }
96
97 #endif