OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
MueLuPreconditioner.h
Go to the documentation of this file.
1 //
2 // Class MueLuPreconditioner
3 // Interface to the SAAMG solver of MueLu. Here it is used as preconditioner for Belos
4 // iterative solvers.
5 //
6 // Copyright (c) 2017 - 2020, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
7 // All rights reserved
8 //
9 // Implemented as part of the PhD thesis
10 // "Precise Simulations of Multibunches in High Intensity Cyclotrons"
11 //
12 // This file is part of OPAL.
13 //
14 // OPAL is free software: you can redistribute it and/or modify
15 // it under the terms of the GNU General Public License as published by
16 // the Free Software Foundation, either version 3 of the License, or
17 // (at your option) any later version.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
21 //
22 #ifndef MUELU_PRECONDITIONER_H
23 #define MUELU_PRECONDITIONER_H
24 
25 #include "AmrPreconditioner.h"
26 #include "Amr/AmrDefs.h"
27 
28 #include <MueLu.hpp>
29 #include <MueLu_TpetraOperator.hpp>
30 
31 template <class Level>
32 class MueLuPreconditioner : public AmrPreconditioner<amr::matrix_t, Level>
33 {
34 public:
36 
41 
42  typedef MueLu::TpetraOperator<
43  scalar_t,
44  lo_t,
45  go_t,
48 
50 
51  typedef std::map<std::string, Preconditioner> map_t;
52 
53 public:
54 
55  explicit MueLuPreconditioner(const std::string& reuse);
56 
57  void create(const Teuchos::RCP<amr::matrix_t>& A, Level* level_p = nullptr);
58 
59  Teuchos::RCP<amr::operator_t> get();
60 
61  static void fillMap(map_t& map);
62 
63  static std::string convertToMueLuReuseOption(const std::string& reuse);
64 
65 private:
66  void init_m(const std::string& reuse);
67 
68 private:
69  Teuchos::ParameterList params_m;
70 
71  Teuchos::RCP<precond_t> prec_mp;
72 };
73 
74 #include "MueLuPreconditioner.hpp"
75 
76 #endif
long global_ordinal_t
KokkosClassic::DefaultNode::DefaultNodeType node_t
amrex::Box AmrBox_t
Definition: AmrDefs.h:50
amrex::IntVect AmrIntVect_t
Definition: AmrDefs.h:48
int local_ordinal_t
double scalar_t
Teuchos::RCP< precond_t > prec_mp
static std::string convertToMueLuReuseOption(const std::string &reuse)
void init_m(const std::string &reuse)
void create(const Teuchos::RCP< amr::matrix_t > &A, Level *level_p=nullptr)
amr::Preconditioner Preconditioner
Teuchos::ParameterList params_m
MueLu::TpetraOperator< scalar_t, lo_t, go_t, amr::node_t > precond_t
amr::AmrIntVect_t AmrIntVect_t
amr::global_ordinal_t go_t
MueLuPreconditioner(const std::string &reuse)
std::map< std::string, Preconditioner > map_t
static void fillMap(map_t &map)
Teuchos::RCP< amr::operator_t> get()
amr::local_ordinal_t lo_t