OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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
26#include "Amr/AmrDefs.h"
27
28#include <MueLu.hpp>
29#include <MueLu_TpetraOperator.hpp>
30
31template <class Level>
32class MueLuPreconditioner : public AmrPreconditioner<amr::matrix_t, Level>
33{
34public:
36
41
42 typedef MueLu::TpetraOperator<
44 lo_t,
45 go_t,
48
50
51 typedef std::map<std::string, Preconditioner> map_t;
52
53public:
54 explicit MueLuPreconditioner(const std::string& reuse);
55
56 void create(const Teuchos::RCP<amr::matrix_t>& A, Level* level_p = nullptr);
57
58 Teuchos::RCP<amr::operator_t> get();
59
60 static void fillMap(map_t& map);
61
62 static std::string convertToMueLuReuseOption(const std::string& reuse);
63
64private:
65 void init_m(const std::string& reuse);
66
67private:
68 Teuchos::ParameterList params_m;
69 Teuchos::RCP<precond_t> prec_mp;
70};
71
73
74#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